bz2: Initialize variables
authorEdward Hervey <edward@collabora.com>
Tue, 8 Apr 2014 07:51:08 +0000 (09:51 +0200)
committerEdward Hervey <edward@collabora.com>
Tue, 8 Apr 2014 07:55:15 +0000 (09:55 +0200)
There is a small chance that we might end up in the done step without
having any output available.

Furthermore, when going through not_ready, we need to ensure gst_buffer_unmap
has a properly initialized GstMapInfo.

CID #1139923
CID #1139924
CID #1139919
CID #1139920

ext/bz2/gstbz2dec.c
ext/bz2/gstbz2enc.c

index 2d873b8..5a06b19 100644 (file)
@@ -104,11 +104,11 @@ gst_bz2dec_decompress_init (GstBz2dec * b)
 static GstFlowReturn
 gst_bz2dec_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
 {
-  GstFlowReturn flow;
+  GstFlowReturn flow = GST_FLOW_OK;
   GstBuffer *out;
   GstBz2dec *b;
   int r = BZ_OK;
-  GstMapInfo map, omap;
+  GstMapInfo map = GST_MAP_INFO_INIT, omap;
 
   b = GST_BZ2DEC (parent);
 
index 5ff872c..c1c1ee1 100644 (file)
@@ -108,7 +108,7 @@ gst_bz2enc_event (GstPad * pad, GstObject * parent, GstEvent * e)
   b = GST_BZ2ENC (parent);
   switch (GST_EVENT_TYPE (e)) {
     case GST_EVENT_EOS:{
-      GstFlowReturn flow;
+      GstFlowReturn flow = GST_FLOW_OK;
       int r = BZ_FINISH_OK;
 
       do {
@@ -173,7 +173,7 @@ gst_bz2enc_chain (GstPad * pad, GstObject * parent, GstBuffer * in)
   GstBz2enc *b;
   guint n;
   int bz2_ret;
-  GstMapInfo map, omap;
+  GstMapInfo map = GST_MAP_INFO_INIT, omap;
 
   b = GST_BZ2ENC (parent);