diff mbox series

[FFmpeg-devel,2/5] avcodec/flacenc: Remove always-true check

Message ID HE1PR0301MB215481CEE0DE4C8CFF06880D8F4D9@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 2606c48391377681541111263de41c79adeffa49
Headers show
Series [FFmpeg-devel,1/5] avcodec: Remove redundant freeing of extradata of encoders | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 15, 2021, 2:03 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/flacenc.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Michael Niedermayer April 15, 2021, 3:52 p.m. UTC | #1
On Thu, Apr 15, 2021 at 04:03:38AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/flacenc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

LGTM

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 32b2465279..f1e3e1989b 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -1449,12 +1449,11 @@  FF_ENABLE_DEPRECATION_WARNINGS
 
 static av_cold int flac_encode_close(AVCodecContext *avctx)
 {
-    if (avctx->priv_data) {
-        FlacEncodeContext *s = avctx->priv_data;
-        av_freep(&s->md5ctx);
-        av_freep(&s->md5_buffer);
-        ff_lpc_end(&s->lpc_ctx);
-    }
+    FlacEncodeContext *s = avctx->priv_data;
+
+    av_freep(&s->md5ctx);
+    av_freep(&s->md5_buffer);
+    ff_lpc_end(&s->lpc_ctx);
     return 0;
 }