From patchwork Fri Nov 8 10:29:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Tomas_H=C3=A4rdin?= X-Patchwork-Id: 52635 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:2fe5:b0:4a6:1c7:11b7 with SMTP id kw5csp2071810vqb; Fri, 8 Nov 2024 02:29:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVGU7FXD3LPPwdgHSOjVbX7ns9FwCDnVKAUFDHYHAkLCFPo4NbVy0DWwKghG+QnK7WnZbF2fFMkSuslwaR0xGoc@gmail.com X-Google-Smtp-Source: AGHT+IHcovqFAgzM5bjRxiQKeRLkn/sJEXjbqB97bRhrz3cUHdgzJoWYWdsgzH9iTl1UK2A3wyy8 X-Received: by 2002:a05:6402:1ecc:b0:5ce:dea8:890 with SMTP id 4fb4d7f45d1cf-5cf0a31cfccmr1628619a12.9.1731061799376; Fri, 08 Nov 2024 02:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731061799; cv=none; d=google.com; s=arc-20240605; b=hOz+Z0GnF9zBA4zahpXHn/GV816l7syFWn2dx3H1+d36GzL7Wat0CKJzV1Hz+y2YQ/ FF2QrBEqYHX+dQOjYOGs0UyDkW+HHbnAS+6M4/GCBLsA4ZBTDbculjyM5y+tLimDoOaE SFF9u1aYal42S3BGPPX7R55QSFFsUV/e9u5fuwVxnJ1gZGptthHH+FYn2O9O0rVli8Wp s/z8fLJk6cRpDbZu9n+g5uwmPQCj4GbaiMek77hyQzdJAdAHu9drHLDTCL7n1ceBnESB iu+cvacKD+GsWdUBv9fA7l6DD5Z8SnDH5FdoquYTXFcnn3GfAX4xnJDwvFqIRqQIbftJ OFPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:user-agent:references:in-reply-to:date:to:from :message-id:delivered-to; bh=l1UVPyydKAZFkecIoG77UAmJrO0VMBY8i7R/dqi+gqk=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=Y03aVTrh7kAFJcoFPG3tzVbOhxBWlJ6B0bu1x8G7o0rm/mZpGtRgrTEqn3oaymYd3+ LfW8Hd6fNWRjd601huHeyPjyh/ttUq0eY6BQXQG1W2tJlILFM7beZGI6kvFrxVUaNRZU ePE0pJI2SeSXm1sIsMnB7irgRjz6q+tu9jeFGIuG/QDEfDqHFFJN5Y1TYAt/LIOGQ/0l Iodlve9m+ISWdfjk94fNc06nER5on04mHO28BVFitj7LM8jYBT6BeZItLmSEsb1CpHLH XKJ96HnC2sJD2ni3cWcT/xp1VDLVrghl6mtTeWLCouaxgYXfpAU3IqwqFgATf3VQ9i57 TLvA==; dara=google.com 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 ESMTPS id 4fb4d7f45d1cf-5cf03cfd2c1si2227953a12.615.2024.11.08.02.29.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 02:29:59 -0800 (PST) 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 7791B68DDD2; Fri, 8 Nov 2024 12:29:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from glom.nmugroup.com (glom.nmugroup.com [193.183.80.6]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 28B2A68DDBC for ; Fri, 8 Nov 2024 12:29:48 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by glom.nmugroup.com (Postfix) with ESMTP id C593D542875B for ; Fri, 8 Nov 2024 11:29:47 +0100 (CET) Received: from debian.lan (unknown [IPv6:2a00:66c0:a::72c]) (Authenticated sender: git01) by glom.nmugroup.com (Postfix) with ESMTPSA id 64163542844F for ; Fri, 8 Nov 2024 11:29:47 +0100 (CET) Message-ID: <32096f5317b1b0bcc270dfca16f23eceaa77494e.camel@haerdin.se> From: Tomas =?iso-8859-1?q?H=E4rdin?= To: FFmpeg development discussions and patches Date: Fri, 08 Nov 2024 11:29:46 +0100 In-Reply-To: <13261324b2fa866261cca27cf0f33a10bd314202.camel@haerdin.se> References: <13261324b2fa866261cca27cf0f33a10bd314202.camel@haerdin.se> User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] lavf/mxfenc: Return AVERROR(EINVAL) in mxf_write_jpeg2000_subdesc() is pixfmt not set 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: A7u5vfFuAz5l Also passes fate-mxf /Tomas From 164175d6f7e2e1eab767c129d953e6e9ebbfc94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= Date: Fri, 8 Nov 2024 11:26:24 +0100 Subject: [PATCH 2/2] lavf/mxfenc: Return AVERROR(EINVAL) in mxf_write_jpeg2000_subdesc() is pixfmt not set --- libavformat/mxfenc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index abc870f133..a482a6a352 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1483,7 +1483,7 @@ static void mxf_write_avc_subdesc(AVFormatContext *s, AVStream *st) mxf_update_klv_size(s->pb, pos); } -static void mxf_write_jpeg2000_subdesc(AVFormatContext *s, AVStream *st) +static int mxf_write_jpeg2000_subdesc(AVFormatContext *s, AVStream *st) { MXFStreamContext *sc = st->priv_data; AVIOContext *pb = s->pb; @@ -1492,7 +1492,7 @@ static void mxf_write_jpeg2000_subdesc(AVFormatContext *s, AVStream *st) if (!pix_desc) { av_log(s, AV_LOG_ERROR, "Pixel format not set - not writing JPEG2000SubDescriptor\n"); - return; + return AVERROR(EINVAL); } /* JPEG2000 subdescriptor key */ @@ -1543,6 +1543,7 @@ static void mxf_write_jpeg2000_subdesc(AVFormatContext *s, AVStream *st) avio_write(pb, sc->j2k_info.j2k_comp_desc, 3*pix_desc->nb_components); mxf_update_klv_size(pb, pos); + return 0; } static int mxf_write_cdci_desc(AVFormatContext *s, AVStream *st) @@ -1554,7 +1555,7 @@ static int mxf_write_cdci_desc(AVFormatContext *s, AVStream *st) mxf_write_avc_subdesc(s, st); } if (st->codecpar->codec_id == AV_CODEC_ID_JPEG2000) { - mxf_write_jpeg2000_subdesc(s, st); + return mxf_write_jpeg2000_subdesc(s, st); } return 0; } -- 2.39.2