Skip to content

fix out-of-bounds read in EXR extra-channel row copy#233

Open
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:exr-extra-channel-stride
Open

fix out-of-bounds read in EXR extra-channel row copy#233
rootvector2 wants to merge 1 commit into
google:mainfrom
rootvector2:exr-extra-channel-stride

Conversation

@rootvector2

Copy link
Copy Markdown
Contributor

In DecodeImageEXR (lib/extras/dec/exr.cc) the extra-channel copy reads from the input_extra_rows scratch buffer using ec.stride, which is the display-window-wide output stride, but that buffer is filled by the OpenEXR framebuffer with the data-window row stride pixel_stride*row_size (row_size = dataWindow.size().x + 1). When displayWindow is wider than dataWindow the source pointer runs past the populated rows and reads out of bounds, copying heap data into the decoded extra channels. The color copy just above already uses the data-window stride; this makes the extra-channel source match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant