matroskamux: do not use uinitialized clut on error
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 2 May 2014 13:25:01 +0000 (14:25 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 2 May 2014 13:25:01 +0000 (14:25 +0100)
If we're missing part of the clut, do not try to use it. It seems
very likely the break was meant to break out of the switch rather
than from the loop.

Coverity 1139878

gst/matroska/matroska-mux.c

index e1472d9..1009bd3 100644 (file)
@@ -879,7 +879,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads * pads,
           if (!gst_structure_get_int (structure, name, &value)) {
             GST_ERROR_OBJECT (mux, "dvd-spu-clut-change event did not "
                 "contain %s field", name);
-            break;
+            goto break_hard;
           }
           clut[i] = value;
         }
@@ -893,6 +893,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads * pads,
       break;
   }
 
+break_hard:
   if (event != NULL)
     return gst_collect_pads_event_default (pads, data, event, FALSE);