h264: reset current_slice on context reinit
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Apr 2012 13:16:36 +0000 (15:16 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Apr 2012 13:30:34 +0000 (15:30 +0200)
This fixes a null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c

index 2903cf9..117cd7e 100644 (file)
@@ -2975,6 +2975,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
         flush_dpb(s->avctx);
         ff_MPV_common_end(s);
         h->list_count = 0;
+        h->current_slice = 0;
     }
     if (!s->context_initialized) {
         if (h != h0) {