Fixes: out of array access Fixes: 368143798/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6475823425585152
Unified · Split
| @@ -640,7 +640,7 @@ static inline void uyvytoyv12_c(const uint8_t *src, uint8_t *ydst, · 639 unmodified lines | |||
| 640 | } | 640 | } |
| 641 | 641 | ||
| 642 | /** | 642 | /** |
| 643 | * Height should be a multiple of 2 and width should be a multiple of 2. | 643 | * width should be a multiple of 2. |
| 644 | * (If this is a problem for anyone then tell me, and I will fix it.) | 644 | * (If this is a problem for anyone then tell me, and I will fix it.) |
| 645 | */ | 645 | */ |
| 646 | void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, | 646 | void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, |
| @@ -659,6 +659,11 @@ void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, · 12 unmodified lines | |||
| 659 | 659 | ||
| 660 | for (y = 0; y < height; y += 2) { | 660 | for (y = 0; y < height; y += 2) { |
| 661 | int i; | 661 | int i; |
| 662 | if (y + 1 == height) { | ||
| 663 | ydst2 = ydst1; | ||
| 664 | src2 = src1; | ||
| 665 | } | ||
| 666 | |||
| 662 | for (i = 0; i < chromWidth; i++) { | 667 | for (i = 0; i < chromWidth; i++) { |
| 663 | unsigned int b11 = src1[6 * i + 0]; | 668 | unsigned int b11 = src1[6 * i + 0]; |
| 664 | unsigned int g11 = src1[6 * i + 1]; | 669 | unsigned int g11 = src1[6 * i + 1]; |