diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 6157071792..05ab0e70b0 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -2267,8 +2267,10 @@ again: group_size = s->width * channels; tmpbuf = av_malloc(ssize); - if (!tmpbuf) + if (!tmpbuf) { + av_free(five_planes); return AVERROR(ENOMEM); + } if (s->avctx->pix_fmt == AV_PIX_FMT_RGBF32LE || s->avctx->pix_fmt == AV_PIX_FMT_RGBAF32LE) {