Repository navigation
Commit 2a65545
committed
pnm: rewrite PAM header decoder
The new decoding logic does not require any unbounded length allocations.
Behavioral changes:
* The decoder now rejects leading + on numbers, to match PNM.
* The length of custom TUPLTYPEs now has a hard limit. This does not
affect realistic images, and PnmDecoder only accepts a short list of
known TUPLTYPEs anyway. (Without a hard limit, the PAM header
decoding logic would require memory limits to be specified in
advance.)1 parent 256dc9d commit 2a65545
1 file changed
Lines changed: 517 additions & 90 deletions
0 commit comments