alhudz commented on PR #552: URL: https://github.com/apache/commons-imaging/pull/552#issuecomment-4766706468
Added one in `PcxImageParserTest`. It feeds a crafted 128-byte header with `bitsPerPixel=24`, `nPlanes=1` and `xMax=yMax=65535` (so `xSize=ySize=65536`), which makes `rowLength * ySize` (196608 * 65536) overflow `int` and wrap small. - expected: `AllocationRequestException` from the 1 GB `Allocator` guard - before the fix: the wrapped size allocates an undersized buffer and you get an `ArrayIndexOutOfBoundsException` from the `arraycopy` - after: the size is computed in `long` so the guard sees the real ~12 GB request and rejects it Verified the test fails on `master` and passes with the fix. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
