summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-02 16:06:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-02 16:48:58 +0200
commit2428b53f6d306d8d71dec34fa7b0af733d76cfac (patch)
treeed14a7e49713f48c3dd9ad4827f44590271218ef /libavcodec/h264.c
parentdb5b4875514eb7740844f514dbf236c9179a6a93 (diff)
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@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f2bd75623c..2afbc4a1b2 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2909,8 +2909,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];