media/liboggplay/bug487519.patch
author Taras Glek <tglek@mozilla.com>
Sat, 08 Aug 2009 12:07:39 +0200
changeset 31243 ff9eba3f82245af4bbee39ba022725e8ed3998ce
parent 28870 b0766717ce73ca814cd50641d16c6bc76e4dda7b
child 33012 314c78cf870089e5134db3459077ab815271f61a
permissions -rw-r--r--
Bug 504864 - mmap io for JARs; r=benjamin

diff --git a/media/liboggplay/src/liboggplay/oggplay_callback.c b/media/liboggplay/src/liboggplay/oggplay_callback.c
index 428faee..344599a 100644
--- a/media/liboggplay/src/liboggplay/oggplay_callback.c
+++ b/media/liboggplay/src/liboggplay/oggplay_callback.c
@@ -388,7 +388,13 @@ oggplay_callback_audio (OGGZ * oggz, ogg_packet * op, long serialno,
 
   fish_sound_prepare_truncation (decoder->sound_handle, op->granulepos,
                                                                 op->e_o_s);
-  fish_sound_decode (decoder->sound_handle, op->packet, op->bytes);
+  if (fish_sound_decode (decoder->sound_handle, op->packet, op->bytes) != 0) {
+    // Unrecoverable error, disable track
+    op->e_o_s = 1;
+    common->active = 0;
+    common->player->active_tracks--;
+    return OGGZ_ERR_HOLE_IN_DATA;
+  }
 
   if (decoder->sound_info.channels == 0) {
     fish_sound_command(decoder->sound_handle, FISH_SOUND_GET_INFO,