residual/residual — Issue #396: residual bitmap.cpp:decompress_codec3 writes past-the-buffer on the image data it is loading.
Author: juj
Created: 2011-10-28 19:46:26+00:00
State: open

1. Apply this patch https://github.com/juj/residual/commit/de11694c39bfb5f8a22ecd550065ae86d54ba751
2. Load this savegame http://dl.dropbox.com/u/40949268/grim01.gsv
3. Observe that the following is printed to console:

WARNING: Buffer overflow when decoding image: decompress_codec3 walked past the input buffer!!
WARNING: .. when loading image le_0_alloh.zbm.!

The decompress_codec3 function writes past the output buffer when loading the file le_0_alloh.zbm. This crashes the game on windows when exiting the screen where grim01.gsv starts at.

As a workaround, the submitted commit disallows writing past the buffer, but this probably causes visual artifacts. (though none have been observed).