media/liboggplay/handle-read-errors.patch
author Jason Duell <jduell.mcbugs@gmail.com>
Sat, 17 Oct 2009 00:05:27 -0700
changeset 46662 a77022f7680c9486748abe5ddb55cb9af6686cea
parent 33012 314c78cf870089e5134db3459077ab815271f61a
permissions -rw-r--r--
Add run_test_in_child() and do_load_child_test_harness() xpcshell functions (bug 521922). r=bent sr=ted Add necko 'unit_ipc' test directory under e10s, plus simple HTTP test.

diff --git a/media/liboggplay/src/liboggplay/oggplay.c b/media/liboggplay/src/liboggplay/oggplay.c
--- a/media/liboggplay/src/liboggplay/oggplay.c
+++ b/media/liboggplay/src/liboggplay/oggplay.c
@@ -136,16 +136,22 @@ oggplay_initialise(OggPlay *me, int bloc
       
       case OGGZ_ERR_OUT_OF_MEMORY:
         /* ran out of memory during decoding! */
         return E_OGGPLAY_OUT_OF_MEMORY;
       
       case OGGZ_ERR_STOP_ERR:
         /* */
         return E_OGGPLAY_BAD_OGGPLAY;
+
+      default:
+        /* If the read otherwise failed, bail out. */
+        if (i < 0)
+          return E_OGGPLAY_BAD_INPUT;
+        break;
     }
 
     if (me->all_tracks_initialised) {
       break;
     }
   }
 
   /*