diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-12-09 17:19:10 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-12-11 15:17:05 +0100 |
commit | 818d04478ddddb9d775a638062f19ea0d26a4054 (patch) | |
tree | b4e00591c8e3f64d2954e5329d497944873142ec /vcl/source | |
parent | 852bba5478f38edc68bec8d38fba7262474e82ea (diff) |
do not allow both read and write bitmap access to the same bitmap
Since BitmapBuffer stores a copy of the bitmap's palette and the bitmap
can update its state only when SalBitmap::ReleaseBuffer() is called,
setting a palette using write access and then reading the bitmap
before the write access is completed could result in inconsistencies.
I wrote this while debugging tdf#129077, which eventually turned out
to be a different problem, but it still makes sense to check this.
Change-Id: I56e9e36c02f2da652cedb3bbc6eb5b630ebaf3ae
Reviewed-on: https://gerrit.libreoffice.org/84771
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/bitmap/BitmapScaleSuperFilter.cxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx index 9ee6e80c7b40..263b6fdb7f0d 100644 --- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx @@ -1176,6 +1176,7 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const if (!bUseThreads) pScaleRangeFn( aContext, nStartY, nEndY ); + pWriteAccess.reset(); bRet = true; aBitmap.AdaptBitCount(aOutBmp); aBitmap = aOutBmp; diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 3cf09f40e529..87f858de7732 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -634,6 +634,7 @@ bool Bitmap::ImplConvertDown(sal_uInt16 nBitCount, Color const * pExtColor) bRet = true; } + pWriteAcc.reset(); if(bRet) { diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index adb14f014ddf..b8a20fcefe61 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -864,6 +864,7 @@ namespace } } } + xWrite.reset(); rSource.AdaptBitCount(aDestination); |