Author: fejj
Date: 2007-10-11 17:28:47 -0400 (Thu, 11 Oct 2007)
New Revision: 87359
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/mplayer.cpp
Log:
2007-10-11 Jeffrey Stedfast <[EMAIL PROTECTED]>
* mplayer.cpp (convert_to_rgb): Worked around an swscaler crash
where it doesn't handle J-Type picture frames.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-11 20:47:09 UTC (rev 87358)
+++ trunk/moon/src/ChangeLog 2007-10-11 21:28:47 UTC (rev 87359)
@@ -1,3 +1,8 @@
+2007-10-11 Jeffrey Stedfast <[EMAIL PROTECTED]>
+
+ * mplayer.cpp (convert_to_rgb): Worked around an swscaler crash
+ where it doesn't handle J-Type picture frames.
+
2007-10-11 Sebastien Pouliot <[EMAIL PROTECTED]>
* panel.cpp|h: Split Render into Render and RenderChildren, so
Modified: trunk/moon/src/mplayer.cpp
===================================================================
--- trunk/moon/src/mplayer.cpp 2007-10-11 20:47:09 UTC (rev 87358)
+++ trunk/moon/src/mplayer.cpp 2007-10-11 21:28:47 UTC (rev 87359)
@@ -60,13 +60,22 @@
Packet::Packet (AVPacket *pkt)
{
+ size_t msize;
+
stream_id = pkt->stream_index;
duration = pkt->duration;
size = pkt->size;
pts = pkt->pts;
- data = (uint8_t *) g_malloc (size);
+ // pad to allow 32bit-word sized reads
+ msize = (size + 3) & ~0x3;
+
+ // add another word as padding
+ msize += 4;
+
+ data = (uint8_t *) g_malloc (msize);
memcpy (data, pkt->data, size);
+ memset (data + size, 0, msize - size);
}
Packet::~Packet ()
@@ -457,7 +466,7 @@
uint8_t *rgb_dest[3] = { video->rgb_buffer, NULL, NULL};
int rgb_stride [3] = { cc->width * 4, 0, 0 };
- if (frame->data == NULL)
+ if (frame->data == NULL || frame->data[1] == NULL || frame->data[2] ==
NULL)
return;
sws_scale (video->scaler, frame->data, frame->linesize, 0,
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches