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

shans at svn.annodex.net shans at svn.annodex.net
Sat Dec 8 16:26:32 PST 2007


Author: shans
Date: 2007-12-08 16:26:31 -0800 (Sat, 08 Dec 2007)
New Revision: 3308

Modified:
   liboggplay/trunk/src/liboggplay/oggplay_buffer.c
Log:
If the movie is too short to even have a single frame, this at least 
prevents firefox from crashing



Modified: liboggplay/trunk/src/liboggplay/oggplay_buffer.c
===================================================================
--- liboggplay/trunk/src/liboggplay/oggplay_buffer.c	2007-12-09 00:25:53 UTC (rev 3307)
+++ liboggplay/trunk/src/liboggplay/oggplay_buffer.c	2007-12-09 00:26:31 UTC (rev 3308)
@@ -118,9 +118,17 @@
 {
 
   int                   i;
-  OggPlayCallbackInfo * p = 
-            (OggPlayCallbackInfo *)buffer->buffer_list[buffer->last_filled];
+  OggPlayCallbackInfo   *p;
 
+  /* 
+   * we're at last data before we've even started!
+   */
+  if (buffer->last_filled == -1) {
+    return;
+  }
+
+  p = (OggPlayCallbackInfo *)buffer->buffer_list[buffer->last_filled];
+
   for (i = 0; i < me->num_tracks; i++) {
     p->stream_info = OGGPLAY_STREAM_LAST_DATA;
     p++;



More information about the commits mailing list