Commit d14b742
committed
Fix uint32_t overflow of row offsets in avifImageYUVAnyToRGBAnySlow
In the slow YUV-to-RGB fallback in src/reformat.c, the Y/U/V/A row
pointers were computed with 'j * yRowBytes' style multiplications where
both operands are uint32_t. For images whose plane size exceeds 4 GiB
the product wraps around and the loop reads from a different row of the
same buffer, producing silently corrupted output.
Cast the row index to size_t before the multiplication so the offset is
computed in size_t arithmetic, matching what is already done for the
RGB destination pointers a few lines below and the same pattern applied
in c79a400.1 parent 3c66271 commit d14b742
2 files changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| |||
0 commit comments