Fixes: out of array read Fixes: 71726/clusterfuzz-testcase-ffmpeg_SWS_fuzzer-5876893532880896 Fixes: 377735917/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6686071112400896
Unified · Split
| @@ -230,6 +230,8 @@ static void nv24_to_yuv420p_chroma(uint8_t *dst1, int dstStride1, · 229 unmodified lines | |||
| 230 | const uint8_t *src2 = src + srcStride; | 230 | const uint8_t *src2 = src + srcStride; |
| 231 | // average 4 pixels into 1 (interleaved U and V) | 231 | // average 4 pixels into 1 (interleaved U and V) |
| 232 | for (int y = 0; y < h; y += 2) { | 232 | for (int y = 0; y < h; y += 2) { |
| 233 | if (y + 1 == h) | ||
| 234 | src2 = src1; | ||
| 233 | for (int x = 0; x < w; x++) { | 235 | for (int x = 0; x < w; x++) { |
| 234 | dst1[x] = (src1[4 * x + 0] + src1[4 * x + 2] + | 236 | dst1[x] = (src1[4 * x + 0] + src1[4 * x + 2] + |
| 235 | src2[4 * x + 0] + src2[4 * x + 2]) >> 2; | 237 | src2[4 * x + 0] + src2[4 * x + 2]) >> 2; |