changeset 2254:0dfe4e32b19c libavcodec

H.264 max reference pictures fix by (Loren Merritt <lorenm at u dot washington dot edu>)
author michael
date Sat, 25 Sep 2004 09:59:36 +0000
parents 1085c5284bf1
children 507690ff49a2
files h264.c mpegvideo.h
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Fri Sep 24 20:35:59 2004 +0000
+++ b/h264.c	Sat Sep 25 09:59:36 2004 +0000
@@ -5430,6 +5430,9 @@
     }
 
     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;
--- a/mpegvideo.h	Fri Sep 24 20:35:59 2004 +0000
+++ b/mpegvideo.h	Sat Sep 25 09:59:36 2004 +0000
@@ -50,7 +50,7 @@
 
 #define MAX_THREADS 8
 
-#define MAX_PICTURE_COUNT 15
+#define MAX_PICTURE_COUNT 32
 
 #define ME_MAP_SIZE 64
 #define ME_MAP_SHIFT 3