summaryrefslogtreecommitdiffstats
path: root/sys/directdraw/gstdirectdrawsink.c
diff options
context:
space:
mode:
authorDave Robillard <dave@drobilla.net>2009-08-12 01:09:13 -0400
committerDave Robillard <dave@drobilla.net>2009-08-12 01:09:13 -0400
commit41f47a3d610a99ac7e3ed85f6ef3f5c130487c36 (patch)
tree32e5a05cae35f825d43e8439ff6040e3d0c2e90d /sys/directdraw/gstdirectdrawsink.c
parent882524e727a1c378be79f0425298243c24aa3adf (diff)
parente46ff7bda0f7996b456476dccb4a822688a690fb (diff)
downloadgst-plugins-bad-41f47a3d610a99ac7e3ed85f6ef3f5c130487c36.tar.gz
gst-plugins-bad-41f47a3d610a99ac7e3ed85f6ef3f5c130487c36.tar.bz2
gst-plugins-bad-41f47a3d610a99ac7e3ed85f6ef3f5c130487c36.zip
Merge branch 'fdo' into lv2
Diffstat (limited to 'sys/directdraw/gstdirectdrawsink.c')
-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 */