Ticket #554: patchdvboverflow.diff

File patchdvboverflow.diff, 897 bytes (added by Carl Eugen Hoyos, 15 years ago)
  • libavcodec/dvbsubdec.c

    diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
    index ad213c8..fad3887 100644
    a b static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis  
    789789        y_pos++;
    790790
    791791    while (buf < buf_end) {
    792         if (x_pos > region->width || y_pos > region->height) {
     792        if (x_pos >= region->width || y_pos > region->height) {
    793793            av_log(avctx, AV_LOG_ERROR, "Invalid object location!\n");
    794794            return;
    795795        }
    … … static void dvbsub_parse_region_segment(AVCodecContext *avctx,  
    10391039    if (region->width * region->height != region->buf_size) {
    10401040        av_free(region->pbuf);
    10411041
    1042         region->buf_size = region->width * region->height;
     1042        region->buf_size = region->width * (region->height + 1);
    10431043
    10441044        region->pbuf = av_malloc(region->buf_size);
    10451045