From ee809f820fb61f8d9c636350bff783e1ca94750c Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 17 Sep 2024 19:48:29 +0200 Subject: [PATCH] avfilter/vf_tile: change filter options types to signed int --- libavfilter/vf_tile.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c index 2af97fee75..c13b106dc4 100644 --- a/libavfilter/vf_tile.c +++ b/libavfilter/vf_tile.c @@ -34,13 +34,13 @@ typedef struct TileContext { const AVClass *class; - unsigned w, h; - unsigned margin; - unsigned padding; - unsigned overlap; - unsigned init_padding; - unsigned current; - unsigned nb_frames; + int w, h; + int margin; + int padding; + int overlap; + int init_padding; + int current; + int nb_frames; FFDrawContext draw; FFDrawColor blank; AVFrame *out_ref; @@ -74,15 +74,15 @@ static av_cold int init(AVFilterContext *ctx) { TileContext *tile = ctx->priv; - if (tile->w > UINT_MAX / tile->h) { + if (tile->w > INT_MAX / tile->h) { av_log(ctx, AV_LOG_ERROR, "Tile size %ux%u is insane.\n", tile->w, tile->h); return AVERROR(EINVAL); } if (tile->padding) { - if ((tile->w - 1 > (UINT32_MAX - 2 * tile->margin) / tile->padding) || - (tile->h - 1 > (UINT32_MAX - 2 * tile->margin) / tile->padding)) { + if ((tile->w - 1 > (INT32_MAX - 2 * tile->margin) / tile->padding) || + (tile->h - 1 > (INT32_MAX - 2 * tile->margin) / tile->padding)) { av_log(ctx, AV_LOG_ERROR, "Combination of Tile size %ux%u, padding %d and margin %d overflows.\n", tile->w, tile->h, tile->padding, tile->margin); return AVERROR(EINVAL);