Skip to content

Commit

Permalink
check for bad bit counts in Huff encoded data
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hillman <[email protected]>
  • Loading branch information
peterhillman committed Feb 4, 2020
1 parent 7a52d40 commit 801272c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenEXR/IlmImf/ImfHuf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,11 @@ hufUncompress (const char compressed[],

const char *ptr = compressed + 20;

if ( ptr + (nBits+7 )/8 > compressed+nCompressed)
{
throw Iex::InputExc("invalid bit count for data size in Huf data");
}

//
// Fast decoder needs at least 2x64-bits of compressed data, and
// needs to be run-able on this platform. Otherwise, fall back
Expand Down

0 comments on commit 801272c

Please sign in to comment.