Hacker News new | ask | show | jobs
by jasona99 2202 days ago
I actually looked into this when I saw it in the original tweet. I tried with a current Android 10 emulator, crashed SystemUI. Tried with the latest build of AOSP, was a-ok. Whatever the issue was, looks like it got resolved already in either the Android color library or the ImageProcessHelper for the wallpaper (the piece of code that was initially crashing with an out of bounds error). I haven't spent much time looking into exactly when/where it was fixed, though.

Quick edit to add that, despite this, I do not believe those changes have made their way into most devices. It seems the error stemmed from the possibility of returning a value over 255 when a histogram was calculated from the addition of color values. As stated in the article, this seemed to result from the use of the Skia color profile in particular. I do not know about other color profiles. The code mentioned by gruez was what I got when the emulator was crashing.

2 comments

This could explain why it might not have shown up in testing.

It's not just that the image had a non-sRGB colorspace, it's also that the pixel values in this specific image were out of the expected range.

"Out of expected range" values should be the very first thing to test for...
And maybe it was; maybe the colour space aspect also was.

Testing combinations of edges is not so common/obvious.

Could you apply the bugged profile to any image and cause the crash?

GIMP sees it as a JFIF (apparently a predecessor to EXIF) with

"Google/Skia/E3CADAB7BD3DE5E3436874D2A9DEE126 Copyright: Google Inc. 2016"