matroskademux: placate gcc since -Werror is used
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 1 Dec 2011 15:29:15 +0000 (15:29 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 1 Dec 2011 15:29:15 +0000 (15:29 +0000)
Initialize values that GCC cannot prove are not used without
being initialized, and assert that I did not mess up my proof.

gst/matroska/matroska-demux.c

index d8c16a34834cbb90a9c2aad9b8bf72a82e4c5099..414c02fec328d17495c40237452c63289f5f1e7c 100644 (file)
@@ -2757,9 +2757,9 @@ gst_matroska_demux_add_wvpk_header (GstElement * element,
     *buf = newbuf;
     audiocontext->wvpk_block_index += block_samples;
   } else {
-    guint8 *outdata;
+    guint8 *outdata = NULL;
     guint outpos = 0;
-    gsize buf_size, size, out_size;
+    gsize buf_size, size, out_size = 0;
     guint32 block_samples, flags, crc, blocksize;
 
     buf_data = gst_buffer_map (*buf, &buf_size, NULL, GST_MAP_READ);
@@ -2791,6 +2791,8 @@ gst_matroska_demux_add_wvpk_header (GstElement * element,
       if (blocksize == 0 || size < blocksize)
         break;
 
+      g_assert ((newbuf == NULL) == (outdata == NULL));
+
       if (newbuf == NULL) {
         out_size = sizeof (Wavpack4Header) + blocksize;
         newbuf = gst_buffer_new_allocate (NULL, out_size, 0);