History

swscale/rgb2rgb_template: Fix ff_rgb24toyv12_c() with odd height

Fixes: out of array access Fixes: 368143798/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6475823425585152

Michael Niedermayer committed 2 years ago

Commit 14f5d671 parent 08b1bff1 file · +6 −1Browse files

Unified · Split

libswscale/rgb2rgb_template.c+6−1
@@ -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 */
646void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst,646void 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];

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t