[xiph-commits] r3076 - liboggplay/trunk/src/liboggplay

shans at svn.annodex.net shans at svn.annodex.net
Tue Jun 26 19:08:48 PDT 2007


Author: shans
Date: 2007-06-26 19:08:48 -0700 (Tue, 26 Jun 2007)
New Revision: 3076

Modified:
   liboggplay/trunk/src/liboggplay/oggplay_seek.c
Log:
Protection against seeking past end of file



Modified: liboggplay/trunk/src/liboggplay/oggplay_seek.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_seek.c	2007-06-27 02:02:07 UTC (rev 3075)
+++ liboggplay/trunk/src/liboggplay/oggplay_seek.c	2007-06-27 02:08:48 UTC (rev 3076)
@@ -45,6 +45,7 @@
   OggPlaySeekTrash   ** p;
   OggPlayDataHeader  ** end_of_list_p;
   int                   i;
+  int                   eof;
   
   if (me == NULL) {
     return E_OGGPLAY_BAD_OGGPLAY;
@@ -54,6 +55,11 @@
     return E_OGGPLAY_CANT_SEEK;
   }
 
+  eof = me->reader->duration(me->reader);
+  if (eof > -1 && milliseconds > eof) {
+    return E_OGGPLAY_CANT_SEEK;
+  }
+
   if (me->reader->seek != NULL) {
     if 
     (



More information about the commits mailing list