Remove unnecessary NULL checks before g_free()
authorReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 20 Nov 2015 18:48:47 +0000 (10:48 -0800)
committerReynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Fri, 20 Nov 2015 18:48:47 +0000 (10:48 -0800)
g_free() is NULL-safe

(Includes unrelated formatting change to go through
indent checker commit hook)

ext/libav/gstavvidenc.c

index e161732095dcd0351b5bbb9f8860641bda10c239..1df16991c0735dfbec37c2846f766d106f62e20c 100644 (file)
@@ -465,8 +465,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
     goto bad_input_fmt;
 
   /* second pass stats buffer no longer needed */
-  if (ffmpegenc->context->stats_in)
-    g_free (ffmpegenc->context->stats_in);
+  g_free (ffmpegenc->context->stats_in);
 
   /* Store input state and set output state */
   if (ffmpegenc->input_state)
@@ -556,8 +555,7 @@ close_codec:
   }
 cleanup_stats_in:
   {
-    if (ffmpegenc->context->stats_in)
-      g_free (ffmpegenc->context->stats_in);
+    g_free (ffmpegenc->context->stats_in);
     return FALSE;
   }
 }
@@ -665,8 +663,7 @@ gst_ffmpegvidenc_handle_frame (GstVideoEncoder * encoder,
     goto encode_fail;
 
   /* Encoder needs more data */
-  if (!have_data)
-  {
+  if (!have_data) {
     gst_video_codec_frame_unref (frame);
     return GST_FLOW_OK;
   }