[FFmpeg-cvslog] h264: do not let invalid values in h-> ref_count on ff_h264_decode_ref_pic_list_reordering() errors.

Laurent Aimar git at videolan.org
Sun Oct 2 21:37:22 CEST 2011


ffmpeg | branch: release/0.8 | Laurent Aimar <fenrir at videolan.org> | Sun Oct  2 16:06:37 2011 +0200| [cf0052931d5776eafacd7771bc9c40da86e31b09] | committer: Michael Niedermayer

h264: do not let invalid values in h->ref_count on ff_h264_decode_ref_pic_list_reordering() errors.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2428b53f6d306d8d71dec34fa7b0af733d76cfac)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf0052931d5776eafacd7771bc9c40da86e31b09
---

 libavcodec/h264.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a889f42..dcca6bd 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2907,8 +2907,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
         ff_h264_fill_default_ref_list(h);
     }
 
-    if(h->slice_type_nos!=AV_PICTURE_TYPE_I && ff_h264_decode_ref_pic_list_reordering(h) < 0)
+    if(h->slice_type_nos!=AV_PICTURE_TYPE_I && ff_h264_decode_ref_pic_list_reordering(h) < 0) {
+        h->ref_count[1]= h->ref_count[0]= 0;
         return -1;
+    }
 
     if(h->slice_type_nos!=AV_PICTURE_TYPE_I){
         s->last_picture_ptr= &h->ref_list[0][0];



More information about the ffmpeg-cvslog mailing list