6 ms·
I have; but I was talking about whether the Mozilla devs, given no color table in a GIF, assume they actually found one and stored it to a memory location, or h
by jtheory 14y ago
I have; but I was talking about whether the Mozilla devs, given no color table in a GIF, assume they actually found one and stored it to a memory location, or handled the case as correctly as they could (by initializing the memory with a replacement color table).
It's a programming error if they assume the earlier code found an (optional) color table; that's it.
I didn't know the color table was formatted -- kinda obviously, it's just a 3-byte chunk per color, though (i.e., 00ffaa) so any bytes in there will be valid colors... so my original idea that random memory would crash things (by providing an invalid color table) was wrong.
- TazeTSchnitzel 14y agoYou may assume too much here. The code may simply assume a colour table has been populated along the way. There might not even be a check for there being no global colour table or frame colour table.
- jtheory 14y agoThat's exactly what I'm saying -- that may well be the case (and that would be a coding error), or maybe they coded some handling; we can't tell from the results (varyingly-colored pixels in the displayed result).