mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 920571 - Don't read from the trailing stride on the last row of pixels when copying image data in SourceSurfaceCG. r=jrmuizel
This commit is contained in:
parent
7fffb0ca44
commit
e899730348
@ -127,7 +127,9 @@ SourceSurfaceCG::InitFromData(unsigned char *aData,
|
||||
assert(aSize.width >= 0 && aSize.height >= 0);
|
||||
|
||||
void *data = malloc(aStride * aSize.height);
|
||||
memcpy(data, aData, aStride * aSize.height);
|
||||
// Copy all the data except the stride padding on the very last
|
||||
// row since we can't guarantee that is readable.
|
||||
memcpy(data, aData, aStride * (aSize.height - 1) + aSize.width);
|
||||
|
||||
mFormat = aFormat;
|
||||
mImage = CreateCGImage(data, data, aSize, aStride, aFormat);
|
||||
@ -162,7 +164,7 @@ DataSourceSurfaceCG::InitFromData(unsigned char *aData,
|
||||
}
|
||||
|
||||
void *data = malloc(aStride * aSize.height);
|
||||
memcpy(data, aData, aStride * aSize.height);
|
||||
memcpy(data, aData, aStride * (aSize.height - 1) + aSize.width);
|
||||
|
||||
mFormat = aFormat;
|
||||
mImage = CreateCGImage(data, data, aSize, aStride, aFormat);
|
||||
|
Loading…
Reference in New Issue
Block a user