dshow: avoid duplicate NULL check before free
authorrogerdpack <rogerpack2005@gmail.com>
Fri, 17 Jun 2016 20:04:34 +0000 (14:04 -0600)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 23 Jun 2016 01:18:16 +0000 (03:18 +0200)
Signed-off-by: rogerdpack <rogerpack2005@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavdevice/dshow.c

index a60e7c1..f2453e6 100644 (file)
@@ -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);