amrwbdec: Don't use g_return_*_if_fail() on data parsing
authorEdward Hervey <edward@centricular.com>
Wed, 3 Jan 2018 15:02:08 +0000 (16:02 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 3 Jan 2018 15:02:08 +0000 (16:02 +0100)
Those functions can be disabled. Instead just use the (existing)
function.

CID #1427093

ext/amrwbdec/amrwbdec.c

index f90b7b7..cf05d95 100644 (file)
@@ -172,14 +172,12 @@ gst_amrwbdec_parse (GstAudioDecoder * dec, GstAdapter * adapter,
   gint block, mode;
 
   size = gst_adapter_available (adapter);
-  g_return_val_if_fail (size > 0, GST_FLOW_ERROR);
+  if (size < 1)
+    return GST_FLOW_ERROR;
 
   gst_audio_decoder_get_parse_state (dec, &sync, &eos);
 
   /* need to peek data to get the size */
-  if (size < 1)
-    return GST_FLOW_ERROR;
-
   gst_adapter_copy (adapter, header, 0, 1);
   mode = (header[0] >> 3) & 0x0F;
   block = block_size[mode];