aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-10-02 16:06:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-11-06 19:49:12 +0100
commitd1a5b53ededd091484949a33c6e9f97d4612602d (patch)
treee957008640aa6e07a36222e1f1bff135d93a16b9
parent8e6173c76a33ae3358314eace94e3e854c4c2555 (diff)
downloadffmpeg-d1a5b53ededd091484949a33c6e9f97d4612602d.tar.gz
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> (cherry picked from commit 2428b53f6d306d8d71dec34fa7b0af733d76cfac) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3ea61330ec..c3771f2b68 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3940,8 +3940,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
fill_default_ref_list(h);
}
- if(h->slice_type_nos!=FF_I_TYPE && decode_ref_pic_list_reordering(h) < 0)
+ if(h->slice_type_nos!=FF_I_TYPE && decode_ref_pic_list_reordering(h) < 0) {
+ h->ref_count[1]= h->ref_count[0]= 0;
return -1;
+ }
if(h->slice_type_nos!=FF_I_TYPE){
s->last_picture_ptr= &h->ref_list[0][0];