Skip to content

Conversation

@MatmaRex
Copy link
Contributor

When the location of the data is outside of the range we have
preloaded (for example, if it's before the beginning of the IFD
structure), we have to read it from the stream into a separate buffer.
The offset calculations in this case were incorrect, resulting in
bogus values being read for the affected fields (sometimes parts of
other fields, sometimes binary data).

The included test image, sourced from https://commons.wikimedia.org/wiki/File:U.S._Marines_Prepare_to_board_an_MV-22_Osprey_160509-M-AF202-041.jpg, is in the public domain.


This is a version of pull request #1581 with an added test and more detailed summary. I debugged this independently (https://phabricator.wikimedia.org/T137635) before finding that it already has a patch pending, grumble.

This is my first contribution to PHP, do I need to do anything special?

…m stream

When the location of the data is outside of the range we have
preloaded (for example, if it's before the beginning of the IFD
structure), we have to read it from the stream into a separate buffer.
The offset calculations in this case were incorrect, resulting in
bogus values being read for the affected fields (sometimes parts of
other fields, sometimes binary data).

The included test image, sourced from [1], is in the public domain.

[1] https://commons.wikimedia.org/wiki/File:U.S._Marines_Prepare_to_board_an_MV-22_Osprey_160509-M-AF202-041.jpg
@smalyshev
Copy link
Contributor

merged

@smalyshev smalyshev closed this Jun 14, 2016
hhvm-bot pushed a commit to facebook/hhvm that referenced this pull request Jul 14, 2016
…ream

Summary:
When the location of the data is outside of the range we have
preloaded (for example, if it's before the beginning of the IFD
structure), we have to read it from the stream into a separate buffer.
The offset calculations in this case were incorrect, resulting in
bogus values being read for the affected fields (sometimes parts of
other fields, sometimes binary data).

The included test image, sourced from [1], is in the public domain.

[1] https://commons.wikimedia.org/wiki/File:U.S._Marines_Prepare_to_board_an_MV-22_Osprey_160509-M-AF202-041.jpg

(This is the same fix as PHP commit c794d53c0377be960a17c3279715436e405b83f4 / php/php-src#1943.)
Closes #7208

Reviewed By: Orvid

Differential Revision: D3518486

fbshipit-source-id: e0560e9455177d873b9494f736fb140810b25633
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants