From patchwork Tue Jun 28 11:50:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 36504 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp2598445pzh; Tue, 28 Jun 2022 04:50:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unv0eysmiTI4K/OdIGVz4qBfFgPTq8NhAiGj8rdhyzEpW8dEiBG+mGND2/IWl8QBQxkstg X-Received: by 2002:a17:906:7949:b0:726:40d1:60aa with SMTP id l9-20020a170906794900b0072640d160aamr17303176ejo.511.1656417045946; Tue, 28 Jun 2022 04:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656417045; cv=none; d=google.com; s=arc-20160816; b=ExUZbcj0KIi0peJx3+aqOCyoVb1P3DKA53LHCDScnJvWi65fN+bGAxJowjxf+TorES 8qcE++G9zEv4jTbaZEzXYJoNFQsENghd4665MdixjOvCmp9V3AuGy7rVLB9C+Gtey6mi vH0n6x0tDNUD4rMC5Lxp1acFnePPt5d95186G2Qu1R6mirnWRMY0apk7o5gS4rh4/bl8 9MGGEtSA+wVIOLoO2FW0V5tEVIgYdu1jZRNFWAX9U8Hweeg+t4SZF63OWzuIOdk3bjSL V7DZ84LFxyXKZUvUJuXlxyeMqPwuhu6b2sucrzeHts8i0IM2ABA4qEttJrZyoNw/h13k bZXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:mime-version:message-id:date :to:from:delivered-to; bh=juXATAM0K0kqdmRpx1CgDWj18qblw8OEPs0Cv+2AkPU=; b=MJcRbgE93iBaKs/xU37UadOlYi2eAy/VxXOe5VrFOCigiZqd7MP2jkMOm4IJWOtXKG D9fZ4Etltr3moufrFFZcdC8Du0lE+MGwvdOVfDqvF9+v0xB8rMs7ww4Tg6tq3JZz8DF3 3fu1esR7K0WSsGWSwJf+BftRjsdTdhnX7HZxqZg8bgIl2cuwyQ3jbaxBVzU37CetsimL ifmow+NGZVBo0PFfxYYgv7PSC4lJ4+wr0MZVOxu82azA9UH89sQVOnj/iyiPIFIRdvg5 fsDjTOjMEcRhL3Epwl+ObFClSd7zhJ0pXoRWzc2diFMiMkUsDhoAOhbDs/+leYIm0S7e 5HHA== 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 y10-20020a056402440a00b00437b04e3a9esi1566070eda.105.2022.06.28.04.50.45; Tue, 28 Jun 2022 04:50:45 -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 5B65B68B93B; Tue, 28 Jun 2022 14:50:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbg.qq.com (smtpbg138.qq.com [106.55.201.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2926568B7C0 for ; Tue, 28 Jun 2022 14:50:35 +0300 (EEST) X-QQ-mid: bizesmtp69t1656417029t4rq1qoi Received: from localhost ( [103.107.217.226]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 28 Jun 2022 19:50:26 +0800 (CST) X-QQ-SSF: 01100000002000Z0Z000000A0000000 X-QQ-FEAT: MmehagGbncBqW2KU2zHDS17draPfmoSM2SuEEscpQaKG0PTxGIov6bVOctKLN LJhrpknFbxX5eVAqqWd1pLvWKVN6swxSo6hlQmILKXbymHB5PpRxyqIDpEOZixpC2IWNtPe +IDqhnJECMJNXMlXkskM4Urg+LQ3x0i+woA09CY3aoem0yXw0VLVRJgYmW7TIPxuCNuCkNq QBcdSXutMACwCsGAE4oXRxLz8OTQ5oxPewjIEtgyazRtB7ButfNhnGVHaGQyI64fwBSK4jW EL6KRKrB0ySxbKKgwiA2DNFx7QC6uptDa4JueUtGRlZONib2OSakZI+5DnJKPbyW84BFZPP xo36QzL X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jun 2022 19:50:23 +0800 Message-Id: <20220628115023.54166-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgspam:qybgspam10 Subject: [FFmpeg-devel] [PATCH] avcodec/encode: change the assert0 from (ret <= 0) to (ret >= 0) 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 Cc: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QjTYM11hO4VL Because the codec->cb.encode return 0 is successed, and the negative error code should failed. Signed-off-by: Steven Liu --- libavcodec/encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/encode.c b/libavcodec/encode.c index b68bf1e184..b43a16f708 100644 --- a/libavcodec/encode.c +++ b/libavcodec/encode.c @@ -217,7 +217,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt) avpkt->pts = avpkt->dts = frame->pts; } - av_assert0(ret <= 0); + av_assert0(ret >= 0); emms_c();