mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 10:15:22 +00:00
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.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit bb13cdbe27
)
This commit is contained in:
parent
bcf3ac039b
commit
8b7f2f0ec5
@ -363,6 +363,11 @@ static int config_input(AVFilterLink *inlink)
|
||||
}
|
||||
|
||||
if (mi_ctx->mi_mode == MI_MODE_MCI) {
|
||||
if (mi_ctx->b_width < 2 || mi_ctx->b_height < 2) {
|
||||
av_log(inlink->dst, AV_LOG_ERROR, "Height or width < %d\n",
|
||||
2 * mi_ctx->mb_size);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
mi_ctx->pixel_mvs = av_mallocz_array(width * height, sizeof(PixelMVS));
|
||||
mi_ctx->pixel_weights = av_mallocz_array(width * height, sizeof(PixelWeights));
|
||||
mi_ctx->pixel_refs = av_mallocz_array(width * height, sizeof(PixelRefs));
|
||||
|
Loading…
Reference in New Issue
Block a user