summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2007-11-12 17:59:40 +0000
committerEdward Hervey <bilboed@bilboed.com>2007-11-12 17:59:40 +0000
commit7522192fab2995abc74061b96801da0663701771 (patch)
treef6af64f2dcc189298e853e960044b173ffe710b0
parent8deb4fbd925656c38ad5b6553769e524e707dba9 (diff)
gst/qtdemux/qtdemux.c: Properly free QTDemuxSamples array.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_change_state), (qtdemux_parse_samples): Properly free QTDemuxSamples array. Protect table write with a sensible check, some files apparently DO contain stts values starting with 0 :(
-rw-r--r--ChangeLog8
-rw-r--r--gst/qtdemux/qtdemux.c12
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5aaf4c31..875891f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-12 Edward Hervey <bilboed@bilboed.com>
+
+ * gst/qtdemux/qtdemux.c: (gst_qtdemux_change_state),
+ (qtdemux_parse_samples):
+ Properly free QTDemuxSamples array.
+ Protect table write with a sensible check, some files apparently DO contain
+ stts values starting with 0 :(
+
2007-11-12 Stefan Kost <ensonic@users.sf.net>
* gst/avi/gstavidemux.c:
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 63dc97ec..1a933246 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -914,10 +914,12 @@ gst_qtdemux_change_state (GstElement * element, GstStateChange transition)
if (stream->pad)
gst_element_remove_pad (element, stream->pad);
- g_free (stream->samples);
+ if (stream->samples)
+ g_free (stream->samples);
if (stream->caps)
gst_caps_unref (stream->caps);
- g_free (stream->segments);
+ if (stream->segments)
+ g_free (stream->segments);
g_free (stream);
}
qtdemux->n_streams = 0;
@@ -2570,8 +2572,10 @@ qtdemux_parse_samples (GstQTDemux * qtdemux, QtDemuxStream * stream,
for (i = 0; i < n_sample_syncs; i++) {
/* note that the first sample is index 1, not 0 */
index = QT_UINT32 ((guint8 *) stss->data + offset);
- samples[index - 1].keyframe = TRUE;
- offset += 4;
+ if (index > 0) {
+ samples[index - 1].keyframe = TRUE;
+ offset += 4;
+ }
}
}
} else {