diff mbox series

[FFmpeg-devel,05/16] avcodec/ra144enc: Don't free unnecessarily

Message ID 20200913025753.274772-5-andreas.rheinhardt@gmail.com
State Accepted
Commit 8bbd97109c993b50a00a88f2b773252ed1b83fc0
Headers show
Series [FFmpeg-devel,01/16] avcodec/snowdec: Use ff_snow_common_init() directly
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 13, 2020, 2:57 a.m. UTC
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 | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/ra144enc.c b/libavcodec/ra144enc.c
index 059f582334..c6965c5c47 100644
--- a/libavcodec/ra144enc.c
+++ b/libavcodec/ra144enc.c
@@ -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;
 }