Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sanity check ScanlineInput bytesPerLine instead of lineOffset size #863

Conversation

peterhillman
Copy link
Contributor

Address https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27409
Updates the filesize check added by #824 to files with a large number of scanlines, rather than a large number of chunks, giving more protection against very small specially crafted files causing large memory allocations.

#824 prevented large memory allocations for scanline offset tables in files which were too small to contain large tables. ScanLineInput files have a 'scanline offset table' (one per chunk) as well as 'bytesPerLine' and 'offsetInLineBuffer' tables (each one per scanline). DWAB files contain 256 scanlines per chunk, so can have a huge bytesPerLine table with only a moderate scanline offset table.

Signed-off-by: Peter Hillman peterh@wetafx.co.nz

Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cary-ilm cary-ilm merged commit bc88cdb into AcademySoftwareFoundation:master Nov 19, 2020
cary-ilm added a commit to cary-ilm/openexr that referenced this pull request May 12, 2021
…cademySoftwareFoundation#863)

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
cary-ilm added a commit to cary-ilm/openexr that referenced this pull request May 12, 2021
…cademySoftwareFoundation#863)

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>
cary-ilm added a commit that referenced this pull request May 16, 2021
* double-check unpackedBuffer created in DWA uncompress

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* compute Huf codelengths using 64 bit to prevent shift overflow

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Avoid overflow in calculateNumTiles when size=MAX_INT (#825)

* Avoid overflow in calculateNumTiles when size=MAX_INT

Signed-off-by: Cary Phillips <cary@ilm.com>

* Compute level size with 64 bits to avoid overflow

Signed-off-by: Cary Phillips <cary@ilm.com>

* More efficient handling of filled channels reading tiles with scanline API (#830)

* refactor channel filling in InputFile API with tiled source

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* handle edge-case of empty framebuffer

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* fix undefined behavior: ignore unused bits in B44 mode detection (#832)


Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Fix overflow computing deeptile sample table size (#861)


Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* sanity check ScanlineInput bytesPerLine instead of lineOffset size (#863)

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

Co-authored-by: Cary Phillips <cary@ilm.com>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Release notes for v2.4.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* Bump version for v2.4.3

Signed-off-by: Cary Phillips <cary@ilm.com>

* reduce size limit for scanline files; prevent large chunkoffset allocations (#824)

* reduce size limit for scanline files; protect against large chunkoffset allocations

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* bugfix for memory limit changes

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* rearrange chunkoffset test to protect bytesperline table too

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>

* remove extraneous function declaration; tidy comments

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
Signed-off-by: Cary Phillips <cary@ilm.com>

* Change v2.4.3 release date to May 17, and clean up urls

Signed-off-by: Cary Phillips <cary@ilm.com>

Co-authored-by: Peter Hillman <peterh@wetafx.co.nz>
cary-ilm added a commit that referenced this pull request May 17, 2021
…stead of lineOffset size

This somehow went missing in the cherry-pick/merge.

Signed-off-by: Cary Phillips <cary@ilm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants