We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3e4ccb commit 9324932Copy full SHA for 9324932
1 file changed
src/Image.cc
@@ -535,6 +535,14 @@ Image::loadGIFFromBuffer(uint8_t *buf, unsigned len) {
535
width = gif->SWidth;
536
height = gif->SHeight;
537
538
+ /* Cairo limit:
539
+ * https://lists.cairographics.org/archives/cairo/2010-December/021422.html
540
+ */
541
+ if (width > 32767 || height > 32767) {
542
+ GIF_CLOSE_FILE(gif);
543
+ return CAIRO_STATUS_INVALID_SIZE;
544
+ }
545
+
546
uint8_t *data = (uint8_t *) malloc(width * height * 4);
547
if (!data) {
548
GIF_CLOSE_FILE(gif);
0 commit comments