OSDN Git Service

h264: proper cleanup in ff_h264_alloc_tables() if DPB alloc fails
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Dec 2014 16:47:56 +0000 (16:47 +0000)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 3 Dec 2014 02:51:27 +0000 (02:51 +0000)
CC: libav-devel@libav.org
libavcodec/h264.c

index cb29d36..67c7eef 100644 (file)
@@ -449,7 +449,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);