I can reproduce a crash in libmpeg2 with MPlayer on the sample:

http://samples.mplayerhq.hu/MPEG2/libmpeg2-crash.vob

The crash happens both with the internal forked copy and with the
upstream version.

Here is a somewhat ugly patch that we used to apply to the forked
copy and that does fix the crash.  If you know a better solution,
we are all ears.

With the patch applies the sample gives ugly artifacting but does
not crash anymore.  To be precise when used with upstream libmpeg2
there is heavy artifacting, but not with MPlayer's forked copy.

Diego
Index: libmpeg2/decode.c
===================================================================
--- libmpeg2/decode.c	(revision 1205)
+++ libmpeg2/decode.c	(working copy)
@@ -345,6 +345,13 @@
     fbuf->buf[1] = buf[1];
     fbuf->buf[2] = buf[2];
     fbuf->id = id;
+    // HACK! FIXME! At first I frame, copy pointers to prediction frame too!
+    if (mpeg2dec->custom_fbuf && !mpeg2dec->fbuf[1]->buf[0]) {
+	mpeg2dec->fbuf[1]->buf[0] = buf[0];
+	mpeg2dec->fbuf[1]->buf[1] = buf[1];
+	mpeg2dec->fbuf[1]->buf[2] = buf[2];
+	mpeg2dec->fbuf[1]->id     = NULL;
+    }
 }
 
 void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf)
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Libmpeg2-devel mailing list
Libmpeg2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel

Reply via email to