mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
9dc6a7f13a
commit
84bc2cea23
|
@ -1231,6 +1231,7 @@ static void free_tables(H264Context *h, int free_rbsp)
|
||||||
av_buffer_pool_uninit(&h->ref_index_pool);
|
av_buffer_pool_uninit(&h->ref_index_pool);
|
||||||
|
|
||||||
if (free_rbsp && h->DPB) {
|
if (free_rbsp && h->DPB) {
|
||||||
|
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||||
for (i = 0; i < MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < MAX_PICTURE_COUNT; i++)
|
||||||
unref_picture(h, &h->DPB[i]);
|
unref_picture(h, &h->DPB[i]);
|
||||||
av_freep(&h->DPB);
|
av_freep(&h->DPB);
|
||||||
|
|
Loading…
Reference in New Issue