opusdec: guard against decoding 0 samples
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 28 Nov 2011 19:38:34 +0000 (19:38 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 2 Dec 2011 15:19:52 +0000 (15:19 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=665078

ext/opus/gstopusdec.c

index 585b383..420caf1 100644 (file)
@@ -414,11 +414,11 @@ opus_dec_chain_parse_data (GstOpusDec * dec, GstBuffer * buffer)
     GST_INFO_OBJECT (dec,
         "Skipping %u samples (%u at 48000 Hz, %u left to skip)", skip,
         scaled_skip, dec->pre_skip);
+  }
 
-    if (GST_BUFFER_SIZE (outbuf) == 0) {
-      gst_buffer_unref (outbuf);
-      outbuf = NULL;
-    }
+  if (GST_BUFFER_SIZE (outbuf) == 0) {
+    gst_buffer_unref (outbuf);
+    outbuf = NULL;
   }
 
   /* Apply gain */