[vlc-devel] [PATCH] respect the x,y offset in Direct2D

Steve Lhomme robux4 at gmail.com
Thu Mar 5 13:35:40 CET 2015


On 05/03/2015 12:57, Steve Lhomme wrote:
> ---
>   modules/video_output/msw/direct2d.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/modules/video_output/msw/direct2d.c b/modules/video_output/msw/direct2d.c
> index f612262..6740a26 100644
> --- a/modules/video_output/msw/direct2d.c
> +++ b/modules/video_output/msw/direct2d.c
> @@ -213,7 +213,9 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
>
>           HRESULT hr = ID2D1Bitmap_CopyFromMemory(sys->d2_bitmap,
>                                                   NULL /*&r_src*/,
> -                                                picture->p[0].p_pixels,
> +                                                picture->p[0].p_pixels +
> +                                                picture->format.i_y_offset * picture->p[0].i_pitch +
> +                                                picture->format.i_x_offset * picture->p[0].i_pixel_pitch,
>                                                   picture->p[0].i_pitch);
>           if (hr != S_OK)
>               msg_Err(vd, "Failed to copy bitmap memory (hr = 0x%x)!",
>

This is incorrect. The last line in particular is going to write further 
than the buffer allocated for display.



More information about the vlc-devel mailing list