summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-02 14:03:47 +0000
committerJanne Grunau <janne-libav@jannau.net>2011-10-10 21:37:36 +0200
commit4c7a232fc81fdbdee279ab819a255f624a22b083 (patch)
tree9fd1467d0b0b93b10964873510837b3999b596fa
parente8ac80fb2c587cc507d9533af8f4313924ee05a1 (diff)
h264: reset h->ref_count in case of errors in ff_h264_decode_ref_pic_list_reordering()
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index aac1a15a92..4dbd06375b 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2857,8 +2857,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];