summaryrefslogtreecommitdiff
path: root/libavcodec/escape130.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-14 04:04:27 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-18 02:52:32 +0200
commit3d51f2a12c97773ec66ec4580f905743f4513ed1 (patch)
treeb4b0d865ea8f67e02e87af3fa54d8ffa3a743938 /libavcodec/escape130.c
parentf4e6aa609d7e8738c172aab2c0608e20ba3f779c (diff)
avcodec/escape130: Cleanup generically on init failure
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/escape130.c')
-rw-r--r--libavcodec/escape130.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c
index 1dd7eedd74..a6fda901de 100644
--- a/libavcodec/escape130.c
+++ b/libavcodec/escape130.c
@@ -128,9 +128,6 @@ static av_cold int escape130_decode_init(AVCodecContext *avctx)
s->buf1 = av_malloc(avctx->width * avctx->height * 3 / 2);
s->buf2 = av_malloc(avctx->width * avctx->height * 3 / 2);
if (!s->old_y_avg || !s->buf1 || !s->buf2) {
- av_freep(&s->old_y_avg);
- av_freep(&s->buf1);
- av_freep(&s->buf2);
av_log(avctx, AV_LOG_ERROR, "Could not allocate buffer.\n");
return AVERROR(ENOMEM);
}
@@ -358,4 +355,5 @@ AVCodec ff_escape130_decoder = {
.close = escape130_decode_close,
.decode = escape130_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};