diff options
author | Richard Wilson <rjw@netsurf-browser.org> | 2005-12-18 15:53:47 +0000 |
---|---|---|
committer | Richard Wilson <rjw@netsurf-browser.org> | 2005-12-18 15:53:47 +0000 |
commit | 17aa1a3ff364c3313b72119a71219ed941b71fc1 (patch) | |
tree | 584eb2511e5afbb1942b5efe493b8a01a0ecda93 /riscos/bitmap.c | |
parent | 5deb39efbf22ce48d9c0e2b3d9d173db9667a11f (diff) | |
download | netsurf-17aa1a3ff364c3313b72119a71219ed941b71fc1.tar.gz netsurf-17aa1a3ff364c3313b72119a71219ed941b71fc1.tar.bz2 |
[project @ 2005-12-18 15:53:47 by rjw]
Ensure bitmap dimensions are as expected before decompression.
svn path=/import/netsurf/; revision=1899
Diffstat (limited to 'riscos/bitmap.c')
-rw-r--r-- | riscos/bitmap.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/riscos/bitmap.c b/riscos/bitmap.c index 65668e563..6e9683e11 100644 --- a/riscos/bitmap.c +++ b/riscos/bitmap.c @@ -557,6 +557,14 @@ void bitmap_decompress(struct bitmap *bitmap) assert(bitmap->compressed); + /* ensure the width/height is correct */ + header = (struct bitmap_compressed_header *)bitmap->compressed; + if ((header->width != bitmap->width) || + (header->height != bitmap->height)) { + LOG(("Warning: Mismatch between bitmap and compressed sizes")); + return; + } + /* create the image memory/header to decompress to */ if (!bitmap_initialise(bitmap, false)) return; @@ -575,7 +583,6 @@ void bitmap_decompress(struct bitmap *bitmap) bitmap->sprite_area = NULL; } else { // LOG(("Decompressed")); - header = (struct bitmap_compressed_header *)bitmap->compressed; area_size = header->input_size + sizeof(struct bitmap_compressed_header); bitmap_compressed_used -= area_size; |