diff options
author | Erik Walthinsen <omega@temple-baptist.org> | 2003-01-31 01:02:43 +0000 |
---|---|---|
committer | Erik Walthinsen <omega@temple-baptist.org> | 2003-01-31 01:02:43 +0000 |
commit | e658752c3cb397dd64a2aea9329c33c4f44db25d (patch) | |
tree | 918714960c826a8c693055c3861c4f3219c72bf5 /gst | |
parent | 1368e3f326c8437efc9718cba132eaf80fb9d99e (diff) | |
download | gst-plugins-bad-e658752c3cb397dd64a2aea9329c33c4f44db25d.tar.gz gst-plugins-bad-e658752c3cb397dd64a2aea9329c33c4f44db25d.tar.bz2 gst-plugins-bad-e658752c3cb397dd64a2aea9329c33c4f44db25d.zip |
Applied patch 13968 plus a GST_DEBUG update, part of bug 104854.
Original commit message from CVS:
Applied patch 13968 plus a GST_DEBUG update, part of bug 104854.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpegaudioparse/gstmp3types.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/mpegaudioparse/gstmp3types.c b/gst/mpegaudioparse/gstmp3types.c index 43c82b69..ef0e4c05 100644 --- a/gst/mpegaudioparse/gstmp3types.c +++ b/gst/mpegaudioparse/gstmp3types.c @@ -33,13 +33,13 @@ mp3_type_find(GstBuffer *buf, gpointer private) { guint8 *data; gint size; - gulong head; + guint32 head; GstCaps *caps; data = GST_BUFFER_DATA (buf); size = GST_BUFFER_SIZE (buf); - GST_DEBUG (0,"mp3typefind: typefind"); + GST_DEBUG (0,"mp3typefind: typefinding on buffer of size %d", size); /* gracefully ripped from libid3 */ if (size >= 3 && @@ -78,8 +78,13 @@ mp3_type_find(GstBuffer *buf, gpointer private) goto done; } } + + /* make sure there is enough of a buffer to check without running over */ + if (size < 4) + return NULL; + /* now with the right postion, do typefinding */ - head = GULONG_FROM_BE(*((gulong *)data)); + head = GUINT32_FROM_BE(*((gulong *)data)); if ((head & 0xffe00000) != 0xffe00000) return NULL; if (!((head >> 17) & 3)) |