avcodec/libutvideoenc: Fix memleak

Fixes: CID1257657

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-15 23:53:24 +02:00
parent c5a07f1f84
commit 1cacecce79

View File

@ -96,8 +96,10 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
* since we cannot decode planes separately with it. * since we cannot decode planes separately with it.
*/ */
ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); ret = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
if (ret < 0) if (ret < 0) {
av_free(info);
return ret; return ret;
}
utv->buf_size = ret; utv->buf_size = ret;
utv->buffer = (uint8_t *)av_malloc(utv->buf_size); utv->buffer = (uint8_t *)av_malloc(utv->buf_size);