nonstreamaudio: Avoid using un-initialized value
authorEdward Hervey <edward@centricular.com>
Fri, 26 May 2017 15:41:39 +0000 (17:41 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 26 May 2017 15:44:17 +0000 (17:44 +0200)
We would end up with cur_position not set but proceed being at its
default value of TRUE. Instead, properly set proceed to FALSE

CID #1409855

gst-libs/gst/audio/gstnonstreamaudiodecoder.c

index 8539303..acc4680 100644 (file)
@@ -593,9 +593,11 @@ gst_nonstream_audio_decoder_set_property (GObject * object, guint prop_id,
               proceed = FALSE;
               GST_WARNING_OBJECT (dec, "switching to new output mode failed");
             }
-          } else
+          } else {
             GST_DEBUG_OBJECT (dec,
                 "cannot call set_output_mode, since it is NULL");
+            proceed = FALSE;
+          }
 
           if (proceed) {
             gst_nonstream_audio_decoder_output_new_segment (dec, cur_position);
@@ -639,9 +641,11 @@ gst_nonstream_audio_decoder_set_property (GObject * object, guint prop_id,
               proceed = FALSE;
               GST_WARNING_OBJECT (dec, "switching to new subsong mode failed");
             }
-          } else
+          } else {
             GST_DEBUG_OBJECT (dec,
                 "cannot call set_subsong_mode, since it is NULL");
+            proceed = FALSE;
+          }
 
           if (proceed) {
             if (GST_CLOCK_TIME_IS_VALID (cur_position))