H.264 max reference pictures fix by (Loren Merritt <lorenm at u dot washington dot...
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Sep 2004 09:59:36 +0000 (09:59 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Sep 2004 09:59:36 +0000 (09:59 +0000)
Originally committed as revision 3504 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.c
libavcodec/mpegvideo.h

index cb026ba..d90fefc 100644 (file)
@@ -5430,6 +5430,9 @@ static inline int decode_seq_parameter_set(H264Context *h){
     }
 
     sps->ref_frame_count= get_ue_golomb(&s->gb);
+    if(sps->ref_frame_count > MAX_PICTURE_COUNT-2){
+        av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n");
+    }
     sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb);
     sps->mb_width= get_ue_golomb(&s->gb) + 1;
     sps->mb_height= get_ue_golomb(&s->gb) + 1;
index d0ad4f0..0c31720 100644 (file)
@@ -50,7 +50,7 @@ enum OutputFormat {
 
 #define MAX_THREADS 8
 
-#define MAX_PICTURE_COUNT 15
+#define MAX_PICTURE_COUNT 32
 
 #define ME_MAP_SIZE 64
 #define ME_MAP_SHIFT 3