From debf4984dfe17799d9da6d520e4f4fd304727084 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 13 Feb 2012 23:04:12 +1100 Subject: [PATCH 1/2] mpegtsmux: Trivial bug fix. Don't copy data from an uninited buffer. --- gst/mpegtsmux/mpegtsmux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c index 9eede8125a..002d6d50d6 100644 --- a/gst/mpegtsmux/mpegtsmux.c +++ b/gst/mpegtsmux/mpegtsmux.c @@ -1087,11 +1087,11 @@ new_packet_m2ts (MpegTsMux * mux, guint8 * data, guint len, gint64 new_pcr) return FALSE; } - new_packet_common_init (mux, buf, data, len); - /* copies the TS data of 188 bytes to the m2ts buffer at an offset of 4 bytes to leave space for writing the timestamp later */ memcpy (GST_BUFFER_DATA (buf) + 4, data, len); + /* After copying the data into the buffer, do other common init (flags and streamheaders) */ + new_packet_common_init (mux, buf, data, len); if (new_pcr < 0) { /* If theres no pcr in current ts packet then just add the packet @@ -1198,9 +1198,10 @@ new_packet_normal_ts (MpegTsMux * mux, guint8 * data, guint len, gint64 new_pcr) return FALSE; } + memcpy (GST_BUFFER_DATA (buf), data, len); + /* After copying the data into the buffer, do other common init (flags and streamheaders) */ new_packet_common_init (mux, buf, data, len); - memcpy (GST_BUFFER_DATA (buf), data, len); GST_BUFFER_TIMESTAMP (buf) = mux->last_ts; ret = gst_pad_push (mux->srcpad, buf); From ac681a6efd8ee4f4046fb93764a351a87566cde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimo=20J=C3=A4rvi?= Date: Sat, 27 Aug 2011 20:58:48 +0300 Subject: [PATCH 2/2] directdrawsink: Fix warnings on 64 bit mingw-w64 gstdirectdrawsink.c:1561:24: error: assignment from incompatible pointer type gstdirectdrawsink.c:2028:3: error: format '%d' expects type 'int', but argument 8 has type 'size_t' https://bugzilla.gnome.org/show_bug.cgi?id=657522 --- sys/directdraw/gstdirectdrawsink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/directdraw/gstdirectdrawsink.c b/sys/directdraw/gstdirectdrawsink.c index bd9b79ca1f..518ca7cf6a 100644 --- a/sys/directdraw/gstdirectdrawsink.c +++ b/sys/directdraw/gstdirectdrawsink.c @@ -1416,7 +1416,7 @@ gst_directdraw_sink_setup_ddraw (GstDirectDrawSink * ddrawsink) return bRet; } -static long FAR PASCAL +static LRESULT FAR PASCAL WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { @@ -2026,7 +2026,7 @@ surface_pitch_bad: GST_BUFFER_SIZE (surface) = size; surface->surface = NULL; GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink, - "allocating a system memory buffer of %d bytes", size); + "allocating a system memory buffer of %" G_GSIZE_FORMAT " bytes", size); #endif