CVE-2026-58997 AI-generated analysis
platform/frameworks/base, hwui JNI Bitmap parceling (libs/hwui/jni/Bitmap.cpp)
validateImageInfo in libs/hwui/jni/Bitmap.cpp now rejects a rowBytes value that is not strictly positive before calling SkBitmap::setInfo, so a bitmap parcel with rowBytes=0 no longer passes this validation.
Root cause
validateImageInfo checked the image info and rowBytes only with SkBitmap().setInfo(info, rowBytes) and had no explicit check on rowBytes. Because the fix adds rowBytes > 0, rowBytes=0 evidently passed the old check. The helper is defined directly above Bitmap_createFromParcel, which reads bitmap geometry from a Parcel, so it most likely vets parceled data, but the shown excerpt does not include the call. The bulletin classifies the issue as information disclosure (ID).
How the fix works
- libs/hwui/jni/Bitmap.cpp:validateImageInfo adds a leading `rowBytes > 0 &&` short-circuit, so a rowBytes of zero or a negative value (int32_t) fails validation before SkBitmap::setInfo is called.
- Single-commit fix; no other files or functions are changed. The commit references the CTS test android.security.cts.BitmapTest#test_513648011.
Completeness
- Covers validateImageInfo. rowBytes <= 0 is now rejected no matter what SkBitmap::setInfo would accept.
- The check is on sign only. rowBytes values that are positive but inconsistent with the pixel payload are left to SkBitmap::setInfo and to later unparcel code, which the material does not show.
- No change to the write side or to other Bitmap creation paths. Index search found no other caller of validateImageInfo, though that search may be incomplete.
Behavior changes
- Inputs with rowBytes equal to 0 (or negative) now fail validateImageInfo where rowBytes=0 previously passed, so such bitmap parcels should now be rejected on unparcel.
- No change for inputs where rowBytes is positive and setInfo accepts it.
Per major
- Android 14: same fix: identical one-line change to validateImageInfo (commit 0ae8cd809b5d, android-security-14.0.0_r31); only the hunk offset differs.
- Android 15: same fix: commit 0f9fbb6ae865 in android-security-15.0.0_r19, the reference diff.
- Android 16: same fix: identical one-line change (commit 215d0c49c082, android-security-16.0.0_r10); the hunk offset differs.
- Android 17: same fix: identical one-line change (commit 14f77e252215, android-security-17.0.0_r3); the hunk offset differs.
Unknowns
- The material does not show the code after the width read in Bitmap_createFromParcel: the validateImageInfo call, how rowBytes feeds the blob size and the pixel copy, or which exception is thrown. The disclosure mechanism is therefore not visible.
- How SkBitmap::setInfo treats rowBytes=0 is not shown in the material.
- Whether the internal Cherrypick-From commits contained more than this one line (for example the CTS test) is not shown.