News Score: Score the News, Sort the News, Rewrite the Headlines

How malloc broke Serenity's JPGLoader, or: how to win the lottery

I got the chance to investigate an interesting bug in SerenityOS this week. It was related to the decoding of JPG images in the operating system. For some reason, when a JPG image is viewed, it comes out like this: Lenna, showing up with incorrect colors. Weird, huh? Also seems like a simple confusion of RGB vs. BGR. And sure enough, making the following change on JPGLoader.cpp: - const Color color { (u8)block.y[pixel_index], (u8)block.cb[pixel_index], (u8)block.cr[pixel_index] }; + const Co...

Read more at sin-ack.github.io

© News Score  score the news, sort the news, rewrite the headlines