summaryrefslogtreecommitdiff
path: root/sys/d3dvideosink
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-04-02 23:08:36 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-04-02 23:10:01 +0200
commitc84278ae04d60c407d13e5175a4fa4cdf2464324 (patch)
tree7f06c119010ab65c8c860c8755de91c9f349110d /sys/d3dvideosink
parentc6164e35696a366ea132ce16daed4543bae03ab6 (diff)
d3dvideosink: Only pass a dest rectangle if set, otherwise pass NULL
Call with an uninitialized rectangle will cause errors. https://bugzilla.gnome.org/show_bug.cgi?id=714998
Diffstat (limited to 'sys/d3dvideosink')
-rw-r--r--sys/d3dvideosink/d3dhelpers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c
index d778e3572..1310e53cb 100644
--- a/sys/d3dvideosink/d3dhelpers.c
+++ b/sys/d3dvideosink/d3dhelpers.c
@@ -1710,6 +1710,7 @@ d3d_stretch_and_copy (GstD3DVideoSink * sink, LPDIRECT3DSURFACE9 back_buffer)
GstD3DVideoSinkClass *klass = GST_D3DVIDEOSINK_GET_CLASS (sink);
GstVideoRectangle *render_rect = NULL;
RECT r, s;
+ RECT *r_p = NULL;
HRESULT hr;
gboolean ret = FALSE;
@@ -1750,11 +1751,13 @@ d3d_stretch_and_copy (GstD3DVideoSink * sink, LPDIRECT3DSURFACE9 back_buffer)
r.top = result.y;
r.right = result.x + result.w;
r.bottom = result.y + result.h;
+ r_p = &r;
} else if (render_rect) {
r.left = 0;
r.top = 0;
r.right = render_rect->w;
r.bottom = render_rect->h;
+ r_p = &r;
}
s.left = sink->crop_rect.x;
@@ -1770,7 +1773,7 @@ d3d_stretch_and_copy (GstD3DVideoSink * sink, LPDIRECT3DSURFACE9 back_buffer)
hr = IDirect3DDevice9_StretchRect (klass->d3d.device.d3d_device, sink->d3d.surface, /* Source Surface */
&s, /* Source Surface Rect (NULL: Whole) */
back_buffer, /* Dest Surface */
- &r, /* Dest Surface Rect (NULL: Whole) */
+ r_p, /* Dest Surface Rect (NULL: Whole) */
klass->d3d.device.filter_type);
if (hr == D3D_OK) {