h264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails
CC: libav-devel@libav.org
This commit is contained in:
parent
56de2897a6
commit
d69d787dad
@ -449,7 +449,7 @@ int ff_h264_alloc_tables(H264Context *h)
|
|||||||
if (!h->DPB) {
|
if (!h->DPB) {
|
||||||
h->DPB = av_mallocz_array(H264_MAX_PICTURE_COUNT, sizeof(*h->DPB));
|
h->DPB = av_mallocz_array(H264_MAX_PICTURE_COUNT, sizeof(*h->DPB));
|
||||||
if (!h->DPB)
|
if (!h->DPB)
|
||||||
return AVERROR(ENOMEM);
|
goto fail;
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
av_frame_unref(&h->DPB[i].f);
|
av_frame_unref(&h->DPB[i].f);
|
||||||
av_frame_unref(&h->cur_pic.f);
|
av_frame_unref(&h->cur_pic.f);
|
||||||
|
Loading…
Reference in New Issue
Block a user