gecko/media/liboggplay/bug464007.patch
Robert O'Callahan 63648a6e54 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
2009-01-30 20:29:20 +13:00

19 lines
706 B
Diff

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);
}