diff --git a/src/kits/interface/Bitmap.cpp b/src/kits/interface/Bitmap.cpp index 0cfffddfdc..5d6caba257 100644 --- a/src/kits/interface/Bitmap.cpp +++ b/src/kits/interface/Bitmap.cpp @@ -977,10 +977,9 @@ BBitmap::_InitObject(BRect bounds, color_space colorSpace, uint32 flags, if (allocationFlags & kFramebuffer) { // the base pointer will now point to an overlay_client_data structure - link.Read(&fBytesPerRow); - size = fBytesPerRow * (bounds.IntegerHeight() + 1); - // bytes_per_row might be modified to match hardware constraints - bytesPerRow = fBytesPerRow; + // bytes per row might be modified to match hardware constraints + link.Read(&bytesPerRow); + size = bytesPerRow * (bounds.IntegerHeight() + 1); } if (fServerArea >= B_OK) {