History

avfilter/vf_deblock: fix posible overreads

Paul B Mahol committed 4 years ago

Commit 9a22c651 parent b74f2121 file · +7 −1Browse files

Unified · Split

libavfilter/vf_deblock.c+7−1
@@ -337,7 +337,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 336 unmodified lines
337337 s->deblockv(dst + x * s->bpc, out->linesize[plane],
338338 FFMIN(block, height), s->ath, s->bth, s->gth, s->dth, s->max);
339339
340− for (y = block; y < height; y += block) {
340+ for (y = block; y < height - block; y += block) {
341341 dst += out->linesize[plane] * block;
342342
343343 s->deblockh(dst, out->linesize[plane],
@@ -353,6 +353,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 9 unmodified lines
353353 s->ath, s->bth, s->gth, s->dth, s->max);
354354 }
355355 }
356+
357+ dst += out->linesize[plane] * block;
358+ for (x = block; x < width; x += block)
359+ s->deblockv(dst + x * s->bpc, out->linesize[plane],
360+ FFMIN(block, height - y), s->ath, s->bth, s->gth, s->dth, s->max);
361+
356362 }
357363
358364 if (in != out)

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