[FFmpeg-cvslog] dshow: avoid duplicate NULL check before free

rogerdpack git at videolan.org
Thu Jun 23 03:38:32 CEST 2016


ffmpeg | branch: master | rogerdpack <rogerpack2005 at gmail.com> | Fri Jun 17 14:04:34 2016 -0600| [bfbffbd7d8fd014a3693c51d7cde9926315a9fa0] | committer: Michael Niedermayer

dshow: avoid duplicate NULL check before free

Signed-off-by: rogerdpack <rogerpack2005 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfbffbd7d8fd014a3693c51d7cde9926315a9fa0
---

 libavdevice/dshow.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index a60e7c1..f2453e6 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -104,14 +104,10 @@ dshow_read_close(AVFormatContext *s)
     if (ctx->device_filter[AudioDevice])
         IBaseFilter_Release(ctx->device_filter[AudioDevice]);
 
-    if (ctx->device_name[0])
-        av_freep(&ctx->device_name[0]);
-    if (ctx->device_name[1])
-        av_freep(&ctx->device_name[1]);
-    if (ctx->device_unique_name[0])
-        av_freep(&ctx->device_unique_name[0]);
-    if (ctx->device_unique_name[1])
-        av_freep(&ctx->device_unique_name[1]);
+    av_freep(&ctx->device_name[0]);
+    av_freep(&ctx->device_name[1]);
+    av_freep(&ctx->device_unique_name[0]);
+    av_freep(&ctx->device_unique_name[1]);
 
     if(ctx->mutex)
         CloseHandle(ctx->mutex);



More information about the ffmpeg-cvslog mailing list