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
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e911f125fc
commit
0663aab1d9
|
@ -391,6 +391,7 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
|
||||||
if (free_rbsp && h->DPB) {
|
if (free_rbsp && h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
ff_h264_unref_picture(h, &h->DPB[i]);
|
ff_h264_unref_picture(h, &h->DPB[i]);
|
||||||
|
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||||
av_freep(&h->DPB);
|
av_freep(&h->DPB);
|
||||||
} else if (h->DPB) {
|
} else if (h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
|
|
Loading…
Reference in New Issue