libvpxenc: fix memleak on error path
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Oct 2012 15:41:36 +0000 (17:41 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Oct 2012 15:41:36 +0000 (17:41 +0200)
Fixes CID733795
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libvpxenc.c

index 2c9ae9e..aecff79 100644 (file)
@@ -491,6 +491,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_log(avctx, AV_LOG_ERROR,
                            "Data buffer alloc (%zu bytes) failed\n",
                            cx_frame->sz);
+                    av_free(cx_frame);
                     return AVERROR(ENOMEM);
                 }
                 memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);
                     return AVERROR(ENOMEM);
                 }
                 memcpy(cx_frame->buf, pkt->data.frame.buf, pkt->data.frame.sz);