avcodec/h264: Clear delayed_pic on deallocation

Fixes use of freed memory

Fixes: case5_av_frame_copy_props.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8714f6f93)

Conflicts:

	libavcodec/h264.c
This commit is contained in:
Michael Niedermayer 2014-12-17 21:27:37 +01:00
parent 9dc6a7f13a
commit 84bc2cea23
1 changed files with 1 additions and 0 deletions

View File

@ -1231,6 +1231,7 @@ static void free_tables(H264Context *h, int free_rbsp)
av_buffer_pool_uninit(&h->ref_index_pool);
if (free_rbsp && h->DPB) {
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
for (i = 0; i < MAX_PICTURE_COUNT; i++)
unref_picture(h, &h->DPB[i]);
av_freep(&h->DPB);