[FFmpeg-devel] [PATCH V1 2/3] lavf/sr: Don't need to check NULL before sws_freeContext

Jun Zhao mypopydev at gmail.com
Sat Jun 1 07:58:25 EEST 2019


From: Jun Zhao <barryjzhao at tencent.com>

sws_freeContext have check the NULL pointer, so don't need to check
NULL before sws_freeContext.

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavfilter/vf_sr.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c
index a371e44..0be572f 100644
--- a/libavfilter/vf_sr.c
+++ b/libavfilter/vf_sr.c
@@ -286,9 +286,7 @@ static av_cold void uninit(AVFilterContext *context)
     }
 
     for (i = 0; i < 3; ++i){
-        if (sr_context->sws_contexts[i]){
-            sws_freeContext(sr_context->sws_contexts[i]);
-        }
+        sws_freeContext(sr_context->sws_contexts[i]);
     }
 }
 
-- 
1.7.1



More information about the ffmpeg-devel mailing list