BPicture: fix BBitmap storage
BeOS save `BBitmap` data size `int32` field before bitmap data array. Part of #1133. Change-Id: I5706b87ca19f2e71e242b98eea6d69bc8ec14558 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10555 Tested-by: Commit checker robot <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -711,6 +711,7 @@ PictureDataWriter::WriteDrawBitmap(const BRect& srcRect, const BRect& dstRect,
|
|||||||
Write<int32>(bytesPerRow);
|
Write<int32>(bytesPerRow);
|
||||||
Write<int32>(colorSpace);
|
Write<int32>(colorSpace);
|
||||||
Write<int32>(flags);
|
Write<int32>(flags);
|
||||||
|
Write<int32>(length);
|
||||||
WriteData(data, length);
|
WriteData(data, length);
|
||||||
EndOp();
|
EndOp();
|
||||||
} catch (status_t& status) {
|
} catch (status_t& status) {
|
||||||
|
|||||||
@@ -1203,19 +1203,19 @@ PicturePlayer::_Play(PicturePlayerCallbacks& callbacks,
|
|||||||
const uint32* bytesPerRow;
|
const uint32* bytesPerRow;
|
||||||
const uint32* colorSpace;
|
const uint32* colorSpace;
|
||||||
const uint32* flags;
|
const uint32* flags;
|
||||||
const void* data;
|
const int32* length;
|
||||||
size_t length;
|
const uint8* data;
|
||||||
if (!reader.Get(sourceRect)
|
if (!reader.Get(sourceRect)
|
||||||
|| !reader.Get(destinationRect) || !reader.Get(width)
|
|| !reader.Get(destinationRect) || !reader.Get(width)
|
||||||
|| !reader.Get(height) || !reader.Get(bytesPerRow)
|
|| !reader.Get(height) || !reader.Get(bytesPerRow)
|
||||||
|| !reader.Get(colorSpace) || !reader.Get(flags)
|
|| !reader.Get(colorSpace) || !reader.Get(flags)
|
||||||
|| !reader.GetRemaining(data, length)) {
|
|| !reader.Get(length) || !reader.Get(data, *length)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks.DrawPixels(*sourceRect, *destinationRect,
|
callbacks.DrawPixels(*sourceRect, *destinationRect,
|
||||||
*width, *height, *bytesPerRow, (color_space)*colorSpace,
|
*width, *height, *bytesPerRow, (color_space)*colorSpace,
|
||||||
*flags, data, length);
|
*flags, data, *length);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user