Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix handling of APNG with 0 delay_den (#313)
  • Loading branch information
cagelight committed Jul 15, 2021
1 parent 98231ab commit 7dfa400
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -16,6 +16,7 @@ Cloudinary Ltd. <*@cloudinary.com>
Google LLC <*@google.com>

# Individuals:
Alexander Sago <cagelight@gmail.com>
Dirk Lemstra <dirk@lemstra.org>
Jon Sneyers <jon@cloudinary.com>
Pieter Wuille
Expand Down
2 changes: 2 additions & 0 deletions lib/extras/codec_apng.cc
Expand Up @@ -342,6 +342,8 @@ Status DecodeImageAPNG(Span<const uint8_t> bytes, ThreadPool* pool,
dop = chunk.p[32];
bop = chunk.p[33];

if (!delay_den) delay_den = 100;

if (w0 > cMaxPNGSize || h0 > cMaxPNGSize || x0 > cMaxPNGSize ||
y0 > cMaxPNGSize || x0 + w0 > w || y0 + h0 > h || dop > 2 ||
bop > 1) {
Expand Down

0 comments on commit 7dfa400

Please sign in to comment.