History

avfilter/vf_minterpolate: Reject too small dimensions

The latter code relies upon the dimensions to be not too small; otherwise one will call av_clip() with min > max lateron which aborts in case ASSERT_LEVEL is >= 2 or one will get a nonsense result that may lead to a heap-buffer-overflow/underflow. The latter has happened in ticket #8248 which this commit fixes.

Andreas Rheinhardt committed 6 years ago

Commit bb13cdb1 parent 0d156eb1 file · +5 −0Browse files

Unified · Split

libavfilter/vf_minterpolate.c+5−0
@@ -363,6 +363,11 @@ static int config_input(AVFilterLink *inlink) · 362 unmodified lines
363363 }
364364
365365 if (mi_ctx->mi_mode == MI_MODE_MCI) {
366+ if (mi_ctx->b_width < 2 || mi_ctx->b_height < 2) {
367+ av_log(inlink->dst, AV_LOG_ERROR, "Height or width < %d\n",
368+ 2 * mi_ctx->mb_size);
369+ return AVERROR(EINVAL);
370+ }
366371 mi_ctx->pixel_mvs = av_mallocz_array(width * height, sizeof(PixelMVS));
367372 mi_ctx->pixel_weights = av_mallocz_array(width * height, sizeof(PixelWeights));
368373 mi_ctx->pixel_refs = av_mallocz_array(width * height, sizeof(PixelRefs));

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