Commit Graph

8 Commits

Author SHA1 Message Date
James Zern
20a94186ce pnmdec,PAM: validate depth before calculating bytes_per_px
fixes potential integer overflow with corrupt files.

Change-Id: I03e27fb14ad559dcd47e2704afdb6be9a163e02e
2017-08-19 13:56:06 -07:00
Vincent Rabaud
d78ff78095 Merge "Fix code to compile with C++." 2017-05-15 15:11:11 +00:00
Vincent Rabaud
c8f14093ac Fix code to compile with C++.
Change-Id: I324236440cb853cb3c8fb278ef22449cd9772ad7
2017-05-15 16:22:03 +02:00
James Zern
497dc6a70d pnmdec: sanitize invalid header output
Change-Id: I034cb00047f725e1cd106d3677db567f1efa0847
2017-05-15 04:57:45 -07:00
James Zern
645f0c53de pnmdec,PAM: set bytes_per_px based on depth when missing
this avoids setting bytes_per_px < depth causing an undersized
allocation for rgb import resulting in a crash.

BUG=b/37930872

Change-Id: I32a86f91528acc084a53d08c9fde9f2f1270a603
2017-05-10 19:15:50 -04:00
Pascal Massimino
17e3c11f99 Add limited PAM decoding support
Should support RGB / RGB_ALPHA / GRAYSCALE correctly, though

Change-Id: Idb1470581ebdfc6efee73009b2abd53889e901cb
2017-03-03 11:19:48 +01:00
Pascal Massimino
1e7ad88b85 PNM header decoder: add some basic numerical validation
see spec: http://netpbm.sourceforge.net/doc/ppm.html

Change-Id: I55e01f8cec79f9124e72d5f3d05be4ad0deae315
2017-02-01 15:03:11 +01:00
Pascal Massimino
dcf9d82a95 imageio: add limited PNM support for reading
see: http://netpbm.sourceforge.net/

Only reads P5 and P6 pnm files for now.

Change-Id: I2332a623f803df67455047f570f1cff9f464480a
2017-02-01 07:41:56 +00:00