]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/hnm4video: Cleanup generically on init failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 14 Sep 2020 15:48:20 +0000 (17:48 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 19 Sep 2020 16:46:53 +0000 (18:46 +0200)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/hnm4video.c

index 177ce1d47a05de004d75d2361813380bca3987f6..ac080e398b2f6dc74c55ab08760d5ce017a5fc49 100644 (file)
@@ -486,9 +486,6 @@ static av_cold int hnm_decode_init(AVCodecContext *avctx)
         || avctx->width * avctx->height == 0
         || avctx->height % 2) {
         av_log(avctx, AV_LOG_ERROR, "av_mallocz() failed\n");
-        av_freep(&hnm->buffer1);
-        av_freep(&hnm->buffer2);
-        av_freep(&hnm->processed);
         return AVERROR(ENOMEM);
     }
 
@@ -519,4 +516,5 @@ AVCodec ff_hnm4_video_decoder = {
     .close          = hnm_decode_end,
     .decode         = hnm_decode_frame,
     .capabilities   = AV_CODEC_CAP_DR1,
+    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };