mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 04:52:28 +00:00
directdrawsink: Fix crash when exposing in GST_STATE_READY
Fixes bug #541962.
This commit is contained in:
parent
6115e0cb0e
commit
182dad5c66
1 changed files with 6 additions and 4 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue