Commit 1a050c2
committed
imageio: Fix vulnerabilities in PSDDecoder from PR #9881
- PSDDecoder: Add dimension limits (max 30,000) to prevent integer
overflows during LinearImage allocation.
- Add checks for stream failure during pixel decoding to handle truncated
files safely.
- Follow existing pattern in this file by using std::runtime_error for
these checks, which are caught and handled by resetting the stream and
returning an empty image.
- Add comment that LinearImage allocation cannot overflow with the new
limits.1 parent f0c3d82 commit 1a050c2
1 file changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
376 | 383 | | |
377 | 384 | | |
378 | 385 | | |
| |||
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
| 404 | + | |
| 405 | + | |
397 | 406 | | |
398 | 407 | | |
399 | 408 | | |
| |||
403 | 412 | | |
404 | 413 | | |
405 | 414 | | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
406 | 418 | | |
407 | 419 | | |
408 | 420 | | |
| |||
413 | 425 | | |
414 | 426 | | |
415 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
416 | 431 | | |
417 | 432 | | |
418 | 433 | | |
| |||
0 commit comments