History

avfilter/vf_gradfun: Do not overread last line

The code works in steps of 2 lines and lacks support for odd height Implementing odd height support is better but for now this fixes the out of array access Fixes: out of array access Fixes: tickets/10702/poc6ffmpe

Michael Niedermayer committed 2 years ago

Commit e4d26661 parent ab0fdae1 file · +1 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_gradfun.c+1−1
@@ -92,7 +92,7 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi · 91 unmodified lines
92 for (y = 0; y < r; y++)92 for (y = 0; y < r; y++)
93 ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2);93 ctx->blur_line(dc, buf + y * bstride, buf + (y - 1) * bstride, src + 2 * y * src_linesize, src_linesize, width / 2);
94 for (;;) {94 for (;;) {
95 if (y < height - r) {95 if (y + 1 < height - r) {
96 int mod = ((y + r) / 2) % r;96 int mod = ((y + r) / 2) % r;
97 uint16_t *buf0 = buf + mod * bstride;97 uint16_t *buf0 = buf + mod * bstride;
98 uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride;98 uint16_t *buf1 = buf + (mod ? mod - 1 : r - 1) * bstride;

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