From patchwork Sat Jun 10 18:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 42029 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c526:b0:117:ac03:c9de with SMTP id gm38csp1980135pzb; Sat, 10 Jun 2023 11:31:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QGh9aYwGmSgx85j0vGH1vRWhCGB/vo3gli/BC4m0EEbnyjFeFbfGiDBfDoXOIPQhHHkro X-Received: by 2002:aa7:d047:0:b0:514:95ce:fb24 with SMTP id n7-20020aa7d047000000b0051495cefb24mr1504846edo.40.1686421882815; Sat, 10 Jun 2023 11:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686421882; cv=none; d=google.com; s=arc-20160816; b=RvuIEDNPVI4YVzuRKI50/SiXA++g5tVoJsqnzZi6D8hj6ePDBBOKn3Z0uJG4L55D9c iUWOybRvUMZimBy10zdE7lXRtwBk1D9XnR8PUZ2U9lDcRrzEBmPHHvYDskNTD2vW3OCJ VubYHXOqZl0mzhE9HahvmBWSiqljTS1JmfIwjZU5OYVHHsKviB6p/pisrWhD1+r8aSZO hrzVH+zIgeIRlD8RHWI9Lj01MH+9eOPVZ3aK/wSp4Pwen0fs869ePUwcp/XCZ3rEsSG6 gxqRs2KyAY69Ay4jqZthT/CkXjcVgOadwOHFxHpYv68oaW8LlmTgI+jsaVwRjxTtGadH GgUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=ZSZQKCFkfA9NdhDa6Pr/zih/llY0p51j3NY5RFSgvIQ=; b=xgyTjV0Pw0XYc7iPT+pVUAKi+04rm5+TB5FJdl8SAcKujkAfnexA5sn1EP8J4PadeJ llk42xc9PSNM0ZbHQ0VbuW576b5FliW9KYeYnuptwJOpCpIKa8XUfcDQg4L2h3zcEQE9 zCp7Exsi0J0soibL5HQGPdO36wXtldP3EW3UZUPwOs44Oh+nVe/wx75pnwv6W4S5Slji kEiFLiDG5z7o5K4D/WWdoRksFsr5xBf0m1d7x/GSLkLEhWOpb/7Ib7RSLa8vcHPXwTQx ct7P77/6/H/gYoV9zmXLRNWNsbWgqWi0ZF7CPXRaBlQuWrkup9rUAquoimGH+YT4awBu W9Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id k12-20020aa7d8cc000000b00516a193597esi3745546eds.508.2023.06.10.11.31.22; Sat, 10 Jun 2023 11:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5901868C238; Sat, 10 Jun 2023 21:31:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-02-1.mymagenta.at (mail-02-1.mymagenta.at [80.109.253.248]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2656668BE2D for ; Sat, 10 Jun 2023 21:31:11 +0300 (EEST) Received: from [192.168.232.136] (helo=ren-mail-psmtp-mg02.) by mail-02.mymagenta.at with esmtp (Exim 4.93) (envelope-from ) id 1q83Mk-002Mwk-GN for ffmpeg-devel@ffmpeg.org; Sat, 10 Jun 2023 20:31:10 +0200 Received: from localhost ([84.115.40.24]) by ren-mail-psmtp-mg02. with ESMTP id 83Mkqh99MbZLD83MkqrD2f; Sat, 10 Jun 2023 20:31:10 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 84.115.40.24 X-CNFS-Analysis: v=2.4 cv=Ufwy9IeN c=1 sm=1 tr=0 ts=6484c16f a=4thelYDX6rwh+ygQwvsI+Q==:117 a=4thelYDX6rwh+ygQwvsI+Q==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=b94tihQPeBZ0Eo0hxYQA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 10 Jun 2023 20:31:08 +0200 Message-Id: <20230610183109.24802-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4xfOt7t3tewVzs4dB2kZUa44Cq5J6gmCVwrRRmzcreU0XbIn+M7veMMvvaF1nt++2hb1pT0oUgFrl8e4XmkMZcZhGJcfk1ESZ9DRIJAq+F9XGQmqYUtpp4 y7dVlCXzYAqJNsYKsJpcAOaRIVFxKjX1Zv7zupYj/UJiGXQvwdpoJYpjVWWYrh+xEUTkZni2i2EahQ== Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/jpeg2000dec: Check for reduction factor and image offset X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ZwRa+gfG8sU/ This combination is not working (it writes out of array) Signed-off-by: Michael Niedermayer --- libavcodec/jpeg2000dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index 0e95cca64e..d6f2a5938e 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -238,6 +238,11 @@ static int get_siz(Jpeg2000DecoderContext *s) return AVERROR_INVALIDDATA; } + if (s->reduction_factor && (s->image_offset_x || s->image_offset_y) ){ + av_log(s->avctx, AV_LOG_ERROR, "reduction factor with image offsets is not fully implemented"); + return AVERROR_PATCHWELCOME; + } + s->ncomponents = ncomponents; if (s->tile_width <= 0 || s->tile_height <= 0) {