libvpxenc: clean memory on error
authorVittorio Giovara <vittorio.giovara@gmail.com>
Sun, 16 Nov 2014 23:22:28 +0000 (00:22 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 17 Nov 2014 23:38:56 +0000 (00:38 +0100)
CC: libav-stable@libav.org
Bug-Id: CID 733795

libavcodec/libvpxenc.c

index 86e4be9..8ff7b28 100644 (file)
@@ -470,6 +470,7 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out,
                     av_log(avctx, AV_LOG_ERROR,
                            "Data buffer alloc (%zu bytes) failed\n",
                            cx_frame->sz);
+                    av_freep(&cx_frame);
                     return AVERROR(ENOMEM);
                 }
                 memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);