ext/ogg/gstoggdemux.c: Another from MikeS:
authorJan Schmidt <thaytan@mad.scientist.com>
Fri, 26 Aug 2005 11:39:01 +0000 (11:39 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Fri, 26 Aug 2005 11:39:01 +0000 (11:39 +0000)
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (ogg_find_peek):
Another from MikeS:
During typefinding, don't support negative offsets
(offsets from the end of the stream) in our typefind->peek() function
- nothing embedded in ogg ever needs them. However, we need to recognise
those requests and reject them, otherwise we return invalid pointers.

ChangeLog
ext/ogg/gstoggdemux.c

index 9b42d0f..873e101 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2005-08-26  Jan Schmidt  <thaytan@mad.scientist.com>
 
+       * ext/ogg/gstoggdemux.c: (ogg_find_peek):
+       Another from MikeS:
+       During typefinding, don't support negative offsets
+       (offsets from the end of the stream) in our typefind->peek() function
+       - nothing embedded in ogg ever needs them. However, we need to recognise
+       those requests and reject them, otherwise we return invalid pointers.
+
+2005-08-26  Jan Schmidt  <thaytan@mad.scientist.com>
+
        * ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose):
        * ext/vorbis/vorbisdec.c: (gst_vorbis_dec_class_init),
        (vorbisdec_finalize), (vorbis_handle_type_packet):
index 40cf3d7..6e1a2b0 100644 (file)
@@ -2396,7 +2396,9 @@ ogg_find_peek (gpointer data, gint64 offset, guint size)
 {
   OggTypeFind *find = (OggTypeFind *) data;
 
-  if (offset + size <= find->packet->bytes) {
+  /* We don't support negative offset (from stream end); nothing embedded in ogg
+   * ever needs them */
+  if (offset >= 0 && offset + size <= find->packet->bytes) {
     return ((guint8 *) find->packet->packet) + offset;
   } else {
     return NULL;