forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check for overflow in PNGImageReader
On a 32 bit machine, an extra large chunk length can result in overflow when added to other small numbers. Check for that overflow in Parse/ParseSize and mark the decoder as failed if it occurs. DCHECK that the length is valid in Decode methods, since it has already been checked by Parse. In ParseSize, check for length > PNG_UINT_31_MAX. This matches Parse, and the PNG spec (https://www.w3.org/TR/PNG/), which demands that all four byte integers are <= PNG_UINT_31_MAX. Bug: 954983 Change-Id: I86d92c2ce1db54b2326188d41d378f3c172bf67c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1588943 Reviewed-by: Noel Gordon <noel@chromium.org> Reviewed-by: Madeleine Barowsky <mbarowsky@chromium.org> Commit-Queue: Leon Scroggins <scroggo@chromium.org> Cr-Commit-Position: refs/heads/master@{#656379}
- Loading branch information
1 parent
e5d5d03
commit 14bd786
Showing
1 changed file
with
34 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters