summaryrefslogtreecommitdiff
path: root/repo/djvulibre/djvulibre-3.5.27-check-image-size.patch
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
committerdavidovski <david@davidovski.xyz>2023-05-17 17:01:27 +0100
commit0d37a1ef234c38b27faba43bc3a22f985d311deb (patch)
treedde8df9f508e7323c3d7df599ceade7705c40acd /repo/djvulibre/djvulibre-3.5.27-check-image-size.patch
parentf29d569cd33a73da5ad675f43a34ad53c5cc9bc6 (diff)
Remove all firmware
Diffstat (limited to 'repo/djvulibre/djvulibre-3.5.27-check-image-size.patch')
-rw-r--r--repo/djvulibre/djvulibre-3.5.27-check-image-size.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/repo/djvulibre/djvulibre-3.5.27-check-image-size.patch b/repo/djvulibre/djvulibre-3.5.27-check-image-size.patch
new file mode 100644
index 0000000..9d0d5b8
--- /dev/null
+++ b/repo/djvulibre/djvulibre-3.5.27-check-image-size.patch
@@ -0,0 +1,16 @@
+diff --git a/libdjvu/IW44Image.cpp b/libdjvu/IW44Image.cpp
+index e8d4b44..aa3d554 100644
+--- a/libdjvu/IW44Image.cpp
++++ b/libdjvu/IW44Image.cpp
+@@ -678,7 +678,11 @@ IW44Image::Map::image(signed char *img8, int rowsize, int pixsep, int fast)
+ size_t sz = bw * bh;
+ if (sz / (size_t)bw != (size_t)bh) // multiplication overflow
+ G_THROW("IW44Image: image size exceeds maximum (corrupted file?)");
++ if (sz == 0)
++ G_THROW("IW44Image: zero size image (corrupted file?)");
+ GPBuffer<short> gdata16(data16,sz);
++ if (data16 == NULL)
++ G_THROW("IW44Image: unable to allocate image data");
+ // Copy coefficients
+ int i;
+ short *p = data16;