From patchwork Tue May 21 02:46:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49078 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp4964562pzb; Mon, 20 May 2024 19:47:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWPLvPgBw2TdGyfpebSOffKHT1PRlHU0OBU0+u4j7V8UAzC0nJMj9MKrIxgz833MnFQ1qR3ElILstP4usTS3Gu7dOSxZjOafoy2Lg== X-Google-Smtp-Source: AGHT+IGpQhUQIVOo/zxItwe17MYKINwDLth684Tp5vaVDEyEKa83BKXCgcdrYLWNkUM57vuQKUVd X-Received: by 2002:a17:906:81c3:b0:a5a:88c7:a89 with SMTP id a640c23a62f3a-a5a88c70e80mr1754977466b.35.1716259672328; Mon, 20 May 2024 19:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716259672; cv=none; d=google.com; s=arc-20160816; b=gJfs53O79ZRSF2nyVzPhSs0gZqtGMeifF7rskxLz0z9zawhiE9B655bjZuXU2hE8AI sAPnXVgb6mUfFYXHsdR8ZErqW0iRLnADVP5O/8l7Gsri0RLltzkwM28h/l4/dpb0OMi+ Yg+vSp5JBl6cjBjaTiMMhj4/ThrOHn6LGicXX4RPLFknYfiRKKZLJe7jh/JNE0zO1jiq 9CkXX4Rveghcj/9/t4b8NFYbo6H2a0B9/cuTGEeoM7ioF9mTAReeuqxwifjDhZ8MJx0U HKVKy75A3gGmmIWjlCHNsPcmwKVP0VWnm2ipL+GgYRXUQ2vW1WwhZGHJjs40YezDSeYN wqGQ== 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:dkim-signature:delivered-to; bh=HLgdh2stHg4L+o7T6EcESD28tJ1BrfTbGNNie1F+kE4=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=WpNhTZdsxvWJC+OVUnbMnwstR/yapT8Q1gJXeS5O/mWFYDbfK5q4IYI6WZqFGZK9y8 wF/XvL9Jmf5rYYYqUcNpvVVj1fFuFE3+Jgm49re65ENR1mvrV2SnW/501Mut3/hMNmGc nmdUtZdoLs9u9BsEK5jKOtsL4dnfXaW5zEIYQd/r8B1ZhNLIiMpOqDcsIj2M/HYfNuGf U0IfkC60ta4MMpvUPOf+jk2vysMgK2MQFrRtxo4qPBYgNM0lrooNOI3vmsKOEJxI4v4e Tsqql553ZayG+nVBQmpjAV4Ybiu7qMl35w/oBkz1Y9EH4Bilro1qcJvQ9MrcB1ye92RJ CTIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=acADl9Ru; 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 a640c23a62f3a-a5a17c2d660si1418701766b.1040.2024.05.20.19.47.51; Mon, 20 May 2024 19:47:52 -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; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=acADl9Ru; 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 3A2F668D32A; Tue, 21 May 2024 05:47:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA91968D2C7 for ; Tue, 21 May 2024 05:47:00 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 16D3E240002 for ; Tue, 21 May 2024 02:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1716259620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7GQO+nqbnzhh2OAA/D+SvZ3TewA8LAu9N3XU2Ast6Q0=; b=acADl9Rup6ekF6+Lb8Kzxj2AMgZPoF/ODrNTMV6Ap40tFPydXpx6FrgNR0TfUfjFs8IsMq jMcJ+h1Du3JtxHgvtfOIKyxwfzmbpYhW726ZMM4VqHy21SM31k8pUoV7qAcFk9Gp0b4cHu LoEli1UdJl5gzIEQuZrZED0F17x/QpbBTVDDROsH3Uw9o5pKsf0sbLI9aNI8jDxJUaTBgl +G+mRYd4vmhqrqBQ5AE3iaO53TIviKmr4OrzrfbJyIkjXiwnjctU9BlYqTM1h0rPBtQUkm +MDPw07oJhUdk/Shso5fxtAhlrojMI5XgVnbJspCEoydBSux2EgmrwCXTkbl2A== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 21 May 2024 04:46:51 +0200 Message-ID: <20240521024652.1006233-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240521024652.1006233-1-michael@niedermayer.cc> References: <20240521024652.1006233-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/7] tools/decode_simple: Check avcodec_send_packet() for errors on flushing 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: NU3utw8iuXIj This will not error but the API allows errors so we should check it Fixes: CID1489999 Unchecked return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- tools/decode_simple.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/decode_simple.c b/tools/decode_simple.c index 6532e368d46..e8c1d6a407e 100644 --- a/tools/decode_simple.c +++ b/tools/decode_simple.c @@ -94,8 +94,9 @@ int ds_run(DecodeContext *dc) goto finish; } - avcodec_send_packet(dc->decoder, NULL); - ret = decode_read(dc, 1); + ret = avcodec_send_packet(dc->decoder, NULL); + if (ret >= 0) + ret = decode_read(dc, 1); if (ret < 0) { fprintf(stderr, "Error flushing: %d\n", ret); return ret;