From 6f09a826fdea5f7081e4e408fb3ac4115e3e3d87 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 24 May 2017 14:54:09 -0300 Subject: [PATCH] Add assert on read_compressed_image() --- src/app/file/ase_format.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/file/ase_format.cpp b/src/app/file/ase_format.cpp index ff0694cec..a582073a4 100644 --- a/src/app/file/ase_format.cpp +++ b/src/app/file/ase_format.cpp @@ -1160,6 +1160,7 @@ static void read_compressed_image(FILE* f, Image* image, size_t chunk_end, FileO size_t uncompressed_bytes = scanline.size() - zstream.avail_out; if (uncompressed_bytes > 0) { + ASSERT(uncompressed_offset+uncompressed_bytes <= uncompressed.size()); if (uncompressed_offset+uncompressed_bytes > uncompressed.size()) throw base::Exception("Bad compressed image.");