diff libmpeg2/decode.c @ 31860:32a214ee10e5

Restore hunk previously removed in r31354. This fixes a crash with http://samples.mplayerhq.hu/MPEG2/libmpeg2-crash.vob
author diego
date Fri, 06 Aug 2010 23:44:31 +0000
parents 020ae1402728
children
line wrap: on
line diff
--- a/libmpeg2/decode.c	Fri Aug 06 23:31:39 2010 +0000
+++ b/libmpeg2/decode.c	Fri Aug 06 23:44:31 2010 +0000
@@ -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)