google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.91k stars 1.2k forks source link

fix wrong calculation of the total bitmap size in util.cc #1641

Open Sumbera opened 3 months ago

Sumbera commented 3 months ago

The total size in bytes is calculated by multiplying the stride by the height, not the width. This is because the stride represents the number of bytes in a row of pixels, and there are height number of rows in the bitmap. So to calculate the total size of the buffer, you need to multiply the stride by the height, not the width.