summaryrefslogtreecommitdiff
path: root/libavcodec/truemotion1.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-05 21:41:06 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-05 23:04:35 +0100
commit46e75617d9700be8840a843237f8571061a63a8e (patch)
tree94aa661584330feedf2dc36d7841c3d3d76e7884 /libavcodec/truemotion1.c
parent845bb401781ef04e342bd558df16a8dbf5f800f9 (diff)
downloadffmpeg-46e75617d9700be8840a843237f8571061a63a8e.tar.gz
truemotion1: fix leaking frame on init failure
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/truemotion1.c')
-rw-r--r--libavcodec/truemotion1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c
index da843c4440..c2022fb8d8 100644
--- a/libavcodec/truemotion1.c
+++ b/libavcodec/truemotion1.c
@@ -489,8 +489,10 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
/* there is a vertical predictor for each pixel in a line; each vertical
* predictor is 0 to start with */
av_fast_malloc(&s->vert_pred, &s->vert_pred_size, s->avctx->width * sizeof(unsigned int));
- if (!s->vert_pred)
+ if (!s->vert_pred) {
+ av_frame_free(&s->frame);
return AVERROR(ENOMEM);
+ }
return 0;
}