Commit ac16a947 authored by Cyril Deguet's avatar Cyril Deguet

* scaled_bitmap.cpp: better fix than [16273] ...

parent 357973f8
...@@ -81,9 +81,11 @@ ScaledBitmap::ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap, ...@@ -81,9 +81,11 @@ ScaledBitmap::ScaledBitmap( intf_thread_t *pIntf, const GenericBitmap &rBitmap,
uint32_t yOffset = ((y * srcHeight) / height) * srcWidth; uint32_t yOffset = ((y * srcHeight) / height) * srcWidth;
pSrcData = ((uint32_t*)rBitmap.getData()) + yOffset; pSrcData = ((uint32_t*)rBitmap.getData()) + yOffset;
*(pDestData++) = *(pSrcData++); if (width == 1)
// Don't start with x=0 to avoid an infinite loop if width==1 {
for( int x = 1; x < width; x++ ) *(pDestData++) = *pSrcData;
}
else for( int x = 0; x < width; x++ )
{ {
*(pDestData++) = *(pSrcData++); *(pDestData++) = *(pSrcData++);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment