Skip to content

Commit e8714f6

Browse files
committed
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>
1 parent 8aa8d12 commit e8714f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: libavcodec/h264.c

+1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
391391
if (free_rbsp && h->DPB) {
392392
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
393393
ff_h264_unref_picture(h, &h->DPB[i]);
394+
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
394395
av_freep(&h->DPB);
395396
} else if (h->DPB) {
396397
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)

0 commit comments

Comments
 (0)