mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 18:40:03 +01:00
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:
@@ -1233,6 +1233,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);
|
||||||
|
|||||||
Reference in New Issue
Block a user