avcodec/h264: fix code that blindly dereferences NULL DPB

Fixes mixed flushing and decoding NULL packets
Found-by: wm4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d9339ab55373b12f078a3e3f1e294d8ff78652dd)

Conflicts:

	libavcodec/h264.c
This commit is contained in:
Michael Niedermayer 2013-12-10 23:41:50 +01:00
parent 70028e917c
commit 6fb0f37def

View File

@ -1839,7 +1839,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
unref_picture(h, &h->DPB[i]);
if (h1->DPB[i].f.data[0] &&
if (h1->DPB && h1->DPB[i].f.data[0] &&
(ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
return ret;
}