[FFmpeg-devel] [PATCH 14/21] avcodec/smacker: Remove redundant checks for NULL before freeing

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat Aug 1 16:46:57 EEST 2020


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/smacker.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 5e1b8c59ff..5e88e18aec 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -254,8 +254,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
     err = 0;
 error:
     for (int i = 0; i < 2; i++) {
-        if (vlc[i].table)
-            ff_free_vlc(&vlc[i]);
+        ff_free_vlc(&vlc[i]);
         av_free(h[i].bits);
         av_free(h[i].lengths);
         av_free(h[i].values);
@@ -732,8 +731,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
 
 error:
     for(i = 0; i < 4; i++) {
-        if(vlc[i].table)
-            ff_free_vlc(&vlc[i]);
+        ff_free_vlc(&vlc[i]);
         av_free(h[i].bits);
         av_free(h[i].lengths);
         av_free(h[i].values);
-- 
2.20.1



More information about the ffmpeg-devel mailing list