1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/h264: do proper cleanup in ff_h264_alloc_tables() in case DPB alloc fails

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-08-21 16:15:16 +02:00
parent 7444cf9a9c
commit 949057c958

View File

@ -473,7 +473,7 @@ int ff_h264_alloc_tables(H264Context *h)
if (!h->DPB) {
h->DPB = av_mallocz_array(H264_MAX_PICTURE_COUNT, sizeof(*h->DPB));
if (!h->DPB)
return AVERROR(ENOMEM);
goto fail;
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
av_frame_unref(&h->DPB[i].f);
av_frame_unref(&h->cur_pic.f);