Bug 464007. Don't crash in liboggplay end-of-file path when the load is cancelled near the end of the stream. r=wiking

--HG--
extra : rebase_source : 608da2277823a60057241c5f5241f34c6894318b
This commit is contained in:
Robert O'Callahan 2009-01-30 20:29:20 +13:00
parent e8b10c972d
commit 63648a6e54
4 changed files with 26 additions and 2 deletions

View File

@ -12,3 +12,6 @@ The patch from Annodex trac ticket 421 is applied to fix bug 459938:
The patch from Bug 468327 (yuv_disable_optimized.patch) is applied
to disable optimized yuv to rgb routines.
The patch from Bug 464007 (bug464007.patch) is applied
to fix oggplay issues.

View File

@ -0,0 +1,18 @@
diff --git a/media/liboggplay/src/liboggplay/oggplay.c b/media/liboggplay/src/liboggplay/oggplay.c
index 9a1c8b8..250064d 100644
--- a/media/liboggplay/src/liboggplay/oggplay.c
+++ b/media/liboggplay/src/liboggplay/oggplay.c
@@ -522,9 +522,11 @@ read_more_data:
}
/*
- * ensure all tracks have their final data packet set to end_of_stream
+ * ensure all tracks have their final data packet set to end_of_stream.
+ * But skip doing this if we're shutting down --- me->buffer may not
+ * be in a safe state.
*/
- if (me->buffer != NULL) {
+ if (me->buffer != NULL && !me->shutdown) {
oggplay_buffer_set_last_data(me, me->buffer);
}

View File

@ -522,9 +522,11 @@ read_more_data:
}
/*
* ensure all tracks have their final data packet set to end_of_stream
* ensure all tracks have their final data packet set to end_of_stream.
* But skip doing this if we're shutting down --- me->buffer may not
* be in a safe state.
*/
if (me->buffer != NULL) {
if (me->buffer != NULL && !me->shutdown) {
oggplay_buffer_set_last_data(me, me->buffer);
}

View File

@ -38,3 +38,4 @@ cd ./src/liboggplay
patch <../../yuv2rgb-vanilla-fix.patch
patch <../../yuv_disable_optimized.patch
cd ../..
patch -p3 <bug464007.patch