Re: [1/2] gdiplus: GdipBitmapLockBits should treat flags == 0 as ImageLockModeRead.
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(a)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
Vincent Povirk <madewokherd(a)gmail.com> wrote:
I think you might want (!(flags & (ImageLockModeRead|ImageLockModeWrite))), in case someone passes ImageLockModeUserInputBuf
This needs an additional test of course, and that should be a separate patch. -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Vincent Povirk