Commit ee3370d
authored
fix(bmp): detect corrupt files where palette doesn't match bpp (#5030)
Extra protections for corrupted BMP files that claim to be palette
images, but have a BPP that doesn't support palette images. Also an
extra guard around accessing the palette array if it is empty.
Add an extra test case for this kind of corruption.
Signed-off-by: Larry Gritz <lg@larrygritz.com>1 parent 1188706 commit ee3370d
File tree
4 files changed
+14
-2
lines changed- src/bmp.imageio
- testsuite/bmp
- ref
- src
4 files changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| |||
391 | 398 | | |
392 | 399 | | |
393 | 400 | | |
394 | | - | |
395 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
396 | 404 | | |
397 | 405 | | |
398 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
Binary file not shown.
0 commit comments