Commit d9339ab5 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h264: fix code that blindly dereferences NULL DPB

Fixes mixed flushing and decoding NULL packets
Found-by: wm4
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e23b1832
...@@ -1851,7 +1851,7 @@ static int decode_update_thread_context(AVCodecContext *dst, ...@@ -1851,7 +1851,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) { for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
unref_picture(h, &h->DPB[i]); unref_picture(h, &h->DPB[i]);
if (h1->DPB[i].f.buf[0] && if (h1->DPB && h1->DPB[i].f.buf[0] &&
(ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0) (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment