media/liboggplay/bug495129a.patch
author Taras Glek <tglek@mozilla.com>
Sat, 08 Aug 2009 12:07:39 +0200
changeset 31243 ff9eba3f82245af4bbee39ba022725e8ed3998ce
parent 28799 95c878a87ccdef055171507bfc0e4bcd0fd3f850
permissions -rw-r--r--
Bug 504864 - mmap io for JARs; r=benjamin

commit 6c8e110015c829e04d8f5fb2ac53b23f468d58ed
Author: Viktor Gal <viktor.gal@maeth.com>
Date:   Thu May 28 10:02:27 2009 +1000

    Fix for ticket 475: fix NULL pointer dereference in oggplay_seek_cleanup function.
    The fix proposed by Chris Double in annodex trac could cause another
    NULL pointer dereference, in case of not enough memory for allocating new buffer.

diff --git a/src/liboggplay/oggplay_seek.c b/src/liboggplay/oggplay_seek.c
index ef150b8..7d7073d 100644
--- a/src/liboggplay/oggplay_seek.c
+++ b/src/liboggplay/oggplay_seek.c
@@ -104,6 +104,9 @@ oggplay_seek_cleanup(OggPlay* me, ogg_int64_t milliseconds)
   /*
    * store the old buffer in it next.
    */
+  if (me->buffer == NULL)
+    return;
+  
   trash->old_buffer = (OggPlayBuffer *)me->buffer;
 
   /*