git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
2c333de
)
don't crash when PNGs are too large.
author
Felix Domke
<tmbinc@elitedvb.net>
Wed, 27 Jun 2007 17:14:03 +0000
(17:14 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Wed, 27 Jun 2007 17:14:03 +0000
(17:14 +0000)
lib/gdi/picload.cpp
patch
|
blob
|
history
diff --git
a/lib/gdi/picload.cpp
b/lib/gdi/picload.cpp
index e3cdc035606e5aaa39405fa03ac2691ae3a906e6..6a79d55283e8ace14380c9fad3efaa14dc4734a2 100644
(file)
--- a/
lib/gdi/picload.cpp
+++ b/
lib/gdi/picload.cpp
@@
-393,7
+393,16
@@
static int png_load(const char *filename, int *x, int *y)
eDebug("[PNG] Error processing");
return 0;
}
-
+
+ if (width * height > 1000000) // 1000x1000 or equiv.
+ {
+ eDebug("[png_load] image size is %d x %d, which is \"too large\".", width, height);
+ png_read_end(png_ptr, info_ptr);
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
+ fclose(fh);
+ return 0;
+ }
+
pic_buffer = new unsigned char[width * height * 3];
*x=width;
*y=height;