From: Sebastian Dröge Date: Wed, 2 Apr 2014 21:08:36 +0000 (+0200) Subject: d3dvideosink: Only pass a dest rectangle if set, otherwise pass NULL X-Git-Tag: 1.19.3~507^2~11513 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c84278ae04d60c407d13e5175a4fa4cdf2464324;p=platform%2Fupstream%2Fgstreamer.git 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 --- diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c index d778e35..1310e53 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) {