From patchwork Wed Aug 31 02:48:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 37570 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp91010pzh; Tue, 30 Aug 2022 19:48:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Cro4nPbiz1pppaJKiKA8/UdzwPz1/KI5F3HiF6AKRaVcB1dgz4oJTrGhsjH5cEFKBvvpP X-Received: by 2002:a05:6402:415:b0:446:230d:2b82 with SMTP id q21-20020a056402041500b00446230d2b82mr22859064edv.200.1661914126418; Tue, 30 Aug 2022 19:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661914126; cv=none; d=google.com; s=arc-20160816; b=KIKrRZQeaddFfZpOkKnZf5eeoqyvD4WNdvqn1/yhAJlGR/lEHHY0AKTENUS7hSuNu6 /mYzKp76mwOyDSKDSALjULnaqcAS4BE/Jz/qRK3XkNgjnTfnwCFMtoK1TondV9AjjaFh AnS0AKZ1FUv4Tzhed1/qa4OjbkxgwIQyP2STTOv9XsUk59+wUEHTXVY9+jAqMh6xWAE/ wBgtWnu+mABZ4Jcs2R50opSTLDfMa3zJuNnn97rNPxy7F3DMZz13PB5nmwi+W/OMYryy Ye1Lkjxr5/6iM6dGnCCJGPwfujHErSWfk6NFcNVPSiBqtJpX6W+p3PyN2KQ2u76ytIlq NbcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=PqamnXsptPcQ3pPVEc65fszdJepq4BOeC45ZQy5V7VE=; b=Qi5JtH7WXVqSTPbOqVTJEKYN5MTXfJG57MZtnTeILjF+9Pf09IpjdEXH8Fahikpo8A g7m+iIUfe1KjRqRoMbGRz8bhfppB+/Gj0szBtM9KjGLZawWxciXnEfBrm56/F440wdbG D7cCH27I5Kwerz5riucmkJQvpSQGv1NXCIPwfsof+knVhQVX+3S5JyhNF82vpytOzC1I 001jVxSH/icmbdDWxSwf7HSXfusGg/ZQQjTgqJUYqjKH5P17bdq9IJhzUX+jaz1ydmR+ IAAlOlmfrTxl4pk9FD75KAti0MxKoyxPx0j1nPIJXb8m9R7SA6SswR+bnODoPoD2PJ8P DgLQ== 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 gs24-20020a170906f19800b0073d9b010076si8684235ejb.822.2022.08.30.19.48.45; Tue, 30 Aug 2022 19:48:46 -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 2893368BB11; Wed, 31 Aug 2022 05:48:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A00FB68BAF6 for ; Wed, 31 Aug 2022 05:48:36 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 2D3C7240D0E for ; Wed, 31 Aug 2022 04:48:36 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id GVaR5sJuo8tK for ; Wed, 31 Aug 2022 04:48:35 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id AA5AB240D03 for ; Wed, 31 Aug 2022 04:48:35 +0200 (CEST) Received: by libav.khirnov.net (Postfix, from userid 1000) id 4C0843A0ABF; Wed, 31 Aug 2022 04:48:34 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 31 Aug 2022 04:48:31 +0200 Message-Id: <20220831024831.27391-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavf/dv: return a meaningful error code from avpriv_dv_produce_packet() 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: afuNti72ZGd5 --- libavformat/dv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dv.c b/libavformat/dv.c index f88fe62349..c888111789 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -404,7 +404,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, if (buf_size < DV_PROFILE_BYTES || !(c->sys = av_dv_frame_profile(c->sys, buf, buf_size)) || buf_size < c->sys->frame_size) { - return -1; /* Broken frame, or not enough data */ + return AVERROR_INVALIDDATA; } /* Queueing audio packet */