summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Isorce <julien.isorce@gmail.com>2009-08-09 12:25:01 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-09 12:25:01 +0200
commit182dad5c6694cd4bee1fa030d9b968687e21d522 (patch)
tree102e86f730173e9711a277084be4f9e866b16615
parent6115e0cb0ef3ae85397297c7e30c2e9b4a0a181e (diff)
downloadgst-plugins-bad-182dad5c6694cd4bee1fa030d9b968687e21d522.tar.gz
gst-plugins-bad-182dad5c6694cd4bee1fa030d9b968687e21d522.tar.bz2
gst-plugins-bad-182dad5c6694cd4bee1fa030d9b968687e21d522.zip
directdrawsink: Fix crash when exposing in GST_STATE_READY
Fixes bug #541962.
-rw-r--r--sys/directdraw/gstdirectdrawsink.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/directdraw/gstdirectdrawsink.c b/sys/directdraw/gstdirectdrawsink.c
index 538227de..bb0332f8 100644
--- a/sys/directdraw/gstdirectdrawsink.c
+++ b/sys/directdraw/gstdirectdrawsink.c
@@ -961,10 +961,12 @@ gst_directdraw_sink_show_frame (GstBaseSink * bsink, GstBuffer * buf)
/* Write each line respecting the destination surface pitch */
data = surf_desc.lpSurface;
- src_pitch = GST_BUFFER_SIZE (buf) / ddrawsink->video_height;
- for (line = 0; line < surf_desc.dwHeight; line++) {
- memcpy (data, GST_BUFFER_DATA (buf) + (line * src_pitch), src_pitch);
- data += surf_desc.lPitch;
+ if (ddrawsink->video_height) {
+ src_pitch = GST_BUFFER_SIZE (buf) / ddrawsink->video_height;
+ for (line = 0; line < surf_desc.dwHeight; line++) {
+ memcpy (data, GST_BUFFER_DATA (buf) + (line * src_pitch), src_pitch);
+ data += surf_desc.lPitch;
+ }
}
/* Unlock the surface */