diff mbox

[FFmpeg-devel] avfilter/vf_tile: remove limit of max tile size

Message ID 20171027164952.6510-1-onemda@gmail.com
State Superseded
Headers show

Commit Message

Paul B Mahol Oct. 27, 2017, 4:49 p.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/vf_tile.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Comments

Nicolas George Oct. 27, 2017, 6:42 p.m. UTC | #1
Le sextidi 6 brumaire, an CCXXVI, Paul B Mahol a écrit :
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/vf_tile.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)

Nack.

This:

./ffmpeg_g -lavfi testsrc2=s=1024x32,tile=layout=65x1 -f framecrc -

used to work, and no longer does with: "Total width 65x1024 is too
much."

Regards,
Paul B Mahol Oct. 27, 2017, 6:51 p.m. UTC | #2
On 10/27/17, Nicolas George <george@nsup.org> wrote:
> Le sextidi 6 brumaire, an CCXXVI, Paul B Mahol a ecrit :
>> Signed-off-by: Paul B Mahol <onemda@gmail.com>
>> ---
>>  libavfilter/vf_tile.c | 12 ++----------
>>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> Nack.
>
> This:
>
> ./ffmpeg_g -lavfi testsrc2=s=1024x32,tile=layout=65x1 -f framecrc -
>
> used to work, and no longer does with: "Total width 65x1024 is too
> much."

That is insane.
diff mbox

Patch

diff --git a/libavfilter/vf_tile.c b/libavfilter/vf_tile.c
index 87e0b940cf..368e4f1a82 100644
--- a/libavfilter/vf_tile.c
+++ b/libavfilter/vf_tile.c
@@ -44,8 +44,6 @@  typedef struct TileContext {
     uint8_t rgba_color[4];
 } TileContext;
 
-#define REASONABLE_SIZE 1024
-
 #define OFFSET(x) offsetof(TileContext, x)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
@@ -68,12 +66,6 @@  static av_cold int init(AVFilterContext *ctx)
 {
     TileContext *tile = ctx->priv;
 
-    if (tile->w > REASONABLE_SIZE || tile->h > REASONABLE_SIZE) {
-        av_log(ctx, AV_LOG_ERROR, "Tile size %ux%u is insane.\n",
-               tile->w, tile->h);
-        return AVERROR(EINVAL);
-    }
-
     if (tile->nb_frames == 0) {
         tile->nb_frames = tile->w * tile->h;
     } else if (tile->nb_frames > tile->w * tile->h) {
@@ -98,12 +90,12 @@  static int config_props(AVFilterLink *outlink)
     const unsigned total_margin_w = (tile->w - 1) * tile->padding + 2*tile->margin;
     const unsigned total_margin_h = (tile->h - 1) * tile->padding + 2*tile->margin;
 
-    if (inlink->w > (INT_MAX - total_margin_w) / tile->w) {
+    if (inlink->w > (INT16_MAX - total_margin_w) / tile->w) {
         av_log(ctx, AV_LOG_ERROR, "Total width %ux%u is too much.\n",
                tile->w, inlink->w);
         return AVERROR(EINVAL);
     }
-    if (inlink->h > (INT_MAX - total_margin_h) / tile->h) {
+    if (inlink->h > (INT16_MAX - total_margin_h) / tile->h) {
         av_log(ctx, AV_LOG_ERROR, "Total height %ux%u is too much.\n",
                tile->h, inlink->h);
         return AVERROR(EINVAL);