[SCM] libav/experimental: dvbsubdec: pass correct input buffer size

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:23:19 UTC 2013


The following commit has been merged in the experimental branch:
commit 5bea615dc383cf3617c5057db4fbc6832fc64137
Author: Jindrich Makovicka <makovick at gmail.com>
Date:   Sat Feb 5 10:43:11 2011 +0000

    dvbsubdec: pass correct input buffer size
    
    In some places, dvbsubdec passes improper input buffer size to
    bitstream reading functions, not accounting for reading pointer
    updates.
    
    Fixed by using buffer_end - buffer pointer instead of fixed buffer length.
    
    Signed-off-by: Jindrich Makovicka <makovick at gmail.com>
    Signed-off-by: Mans Rullgard <mans at mansr.com>

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index fe98798..8cc8d4f 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -792,7 +792,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
                 map_table = NULL;
 
             x_pos += dvbsub_read_2bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_size,
+                                                region->width - x_pos, &buf, buf_end - buf,
                                                 non_mod, map_table);
             break;
         case 0x11:
@@ -807,7 +807,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
                 map_table = NULL;
 
             x_pos += dvbsub_read_4bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_size,
+                                                region->width - x_pos, &buf, buf_end - buf,
                                                 non_mod, map_table);
             break;
         case 0x12:
@@ -817,7 +817,7 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
             }
 
             x_pos += dvbsub_read_8bit_string(pbuf + (y_pos * region->width) + x_pos,
-                                                region->width - x_pos, &buf, buf_size,
+                                                region->width - x_pos, &buf, buf_end - buf,
                                                 non_mod, NULL);
             break;
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list