]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/ra144enc: Don't free unnecessarily
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 12 Sep 2020 21:56:50 +0000 (23:56 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 16 Sep 2020 22:09:08 +0000 (00:09 +0200)
The init function of the real_144 encoder calls its own close function
if a call to ff_lpc_init() fails; yet nothing has been allocated before
that point and ff_lpc_init() can be expected to clean up after itself on
error (the documentation does not say anything to the contrary and the
current implementation can only fail if the only allocation fails, so
there is nothing to clean up on error anyway), so this is unnecessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/ra144enc.c

index 059f582334d5f586de4f275e63b900924baa5fe3..c6965c5c470664798c054d94c3d4946a4d7180e4 100644 (file)
@@ -65,14 +65,11 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx)
     ret = ff_lpc_init(&ractx->lpc_ctx, avctx->frame_size, LPC_ORDER,
                       FF_LPC_TYPE_LEVINSON);
     if (ret < 0)
-        goto error;
+        return ret;
 
     ff_af_queue_init(avctx, &ractx->afq);
 
     return 0;
-error:
-    ra144_encode_close(avctx);
-    return ret;
 }