Skip to content

Commit

Permalink
IMAGES: Make deDXT buffer a 64 byte minimum
Browse files Browse the repository at this point in the history
The DXT algorithms operate on 16 pixels at a time, so the buffer
always needs to be able to fit 16 RGBA pixels (= 64 bytes).

This fixes issue #1.
  • Loading branch information
DrMcCoy committed Dec 14, 2014
1 parent 3c5f24e commit 1e8b6c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/images/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void Decoder::decompress(MipMap &out, const MipMap &in, PixelFormat format) {

out.width = in.width;
out.height = in.height;
out.size = out.width * out.height * 4;
out.size = MAX(out.width * out.height * 4, 64);
out.data = new byte[out.size];

Common::MemoryReadStream *stream = new Common::MemoryReadStream(in.data, in.size);
Expand Down

0 comments on commit 1e8b6c2

Please sign in to comment.