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:
X512
2026-03-20 21:50:48 +00:00
committed by Adrien Destugues
parent 092beb6782
commit 9e7b79a90e
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -711,6 +711,7 @@ PictureDataWriter::WriteDrawBitmap(const BRect& srcRect, const BRect& dstRect,
Write<int32>(bytesPerRow);
Write<int32>(colorSpace);
Write<int32>(flags);
Write<int32>(length);
WriteData(data, length);
EndOp();
} catch (status_t& status) {
+4 -4
View File
@@ -1203,19 +1203,19 @@ PicturePlayer::_Play(PicturePlayerCallbacks& callbacks,
const uint32* bytesPerRow;
const uint32* colorSpace;
const uint32* flags;
const void* data;
size_t length;
const int32* length;
const uint8* data;
if (!reader.Get(sourceRect)
|| !reader.Get(destinationRect) || !reader.Get(width)
|| !reader.Get(height) || !reader.Get(bytesPerRow)
|| !reader.Get(colorSpace) || !reader.Get(flags)
|| !reader.GetRemaining(data, length)) {
|| !reader.Get(length) || !reader.Get(data, *length)) {
break;
}
callbacks.DrawPixels(*sourceRect, *destinationRect,
*width, *height, *bytesPerRow, (color_space)*colorSpace,
*flags, data, length);
*flags, data, *length);
break;
}