11
michezio
34d

Have you heard about the background bug on Android 10? I'm talking about this...

https://xda-developers.com/wallpape...

How the hell does something like that happen?? Who coded that formula without checking it's output boundaries?

Comments
  • 2
    if (value > 255){
    value = 255;
    }
  • 4
    A warning for anyone thinking of trying this out:

    You will have to factory reset to recover from this. Or that is what I have heard.
  • 2
    @sudocode Some phones can boot in safe mode.
  • 1
    @sudocode Or I just remove the wallpaper from custom recovery.
  • 3
    > Who coded that formula without checking it's output boundaries?
    If nobody thought it would ever exceed them... I'm more surprised that the failure of rendering a wallpaper crashes the whole system.
  • 1
    > buffer overflow crash
    You mean ACE, right?
  • 0
    @sbiewald the formula itself "mathematically" never exceeds 255, because it's coefficients are normalized to 1. So if input is 3 value in range(0-255), output will be too.
    But they compute each value by itself, then round it, then sum them. So output can get as high as 258. There is a basic math principle that should be tought as one of the first concept in a programming course (as it is in any physics or math course): never round any non-final value if it's not necessary.
Add Comment