[1/2] gdiplus: GdipBitmapLockBits should treat flags == 0 as ImageLockModeRead.

Vincent Povirk madewokherd at gmail.com
Tue Jul 10 08:07:56 CDT 2012


I think you might want (!(flags &
(ImageLockModeRead|ImageLockModeWrite))), in case someone passes
ImageLockModeUserInputBuf

On Tue, Jul 10, 2012 at 7:45 AM, Dmitry Timoshkov <dmitry at baikal.ru> wrote:
> ---
>  dlls/gdiplus/image.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
> index db79eca..45520fd 100644
> --- a/dlls/gdiplus/image.c
> +++ b/dlls/gdiplus/image.c
> @@ -942,6 +942,8 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
>          return WrongState;
>      }
>
> +    if (!flags) flags = ImageLockModeRead;
> +
>      if (bitmap->bits && bitmap->format == format && !(flags & ImageLockModeUserInputBuf))
>      {
>          /* no conversion is necessary; just use the bits directly */
> --
> 1.7.11.1
>
>
>



More information about the wine-devel mailing list