From patchwork Wed Oct 6 10:14:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 30949 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp218872iob; Wed, 6 Oct 2021 03:14:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfYZDL1av9aFqbpw6WOebOXUofconuL1CaY1Li2QtfyUqcLg8gmnewdlkjfc4tx6p+GTFK X-Received: by 2002:a05:6402:4304:: with SMTP id m4mr559577edc.326.1633515276459; Wed, 06 Oct 2021 03:14:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633515276; cv=none; d=google.com; s=arc-20160816; b=U5araduY/4cpYJZHmYKWzmTO9+gaLOPhLKYjUIoc50aBBxnc08iYxjh6qR8sDZSxxJ 92lFCPq9xi9v/D6nGASiHv3b2L0a48XaJ37FNcgz6RWKIfOmhvKAAIdf876UxM5esMdX EJnUjCLobJKrSK0qCfUcdp9TbdIH0D7/53V2vUnmArZ7SK66ThDe1mFz5QwsmCXdAG/a 3Dr7PjKoJKDnYs1J8v70RF31+V1GuEXGReNszShNIC/CCp0/WSl478o6dnCJxRBQDvTT BgnKmJ8CjjjX9uRw9pht4BilwkqIcfYX7VnAc4VYRCeJQc6wHFYxhZA3z9p5DIpImIDc IeGg== 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:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=EDzCgKYIufrJ2E7K0aX2tE10XTL0dAGz3QYczVouw64=; b=HHPGj+2hgkYguw8ohmJDrRRHtfkv2DtuVBS1FW2I8Smgg+f2QLUwNmLhyry7WR4t7n ZNlVk4GUE3Ypxm7p+JUYR2kQAQV42o1nD+N5IMrURFTMVlMiJT4hVo5MNJpzE6vYnCWW ZWSDTOo1Bp6/IcZPVTCx5Yl5En05bRXGDsvWK+fA7nEF9Lh/kdmV0m/5gNs3dDYR+kL/ v8Lms9CdE96agYLbkFRIP7MFZOx3RnaEpQv4gXavKL3gIiPiiNq0cHyjZdXUqRjScILx a9SHAfv1gBm2wnPSLLw/ZnrZ3psTHoyuIkaNOrGTJndXcBb1U2/CAc19ogi8rLcMnSBT Q0WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=CowearmP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 6si24189614ejk.125.2021.10.06.03.14.28; Wed, 06 Oct 2021 03:14:36 -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=@gmail.com header.s=20210112 header.b=CowearmP; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1C6EE68AA84; Wed, 6 Oct 2021 13:14:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 349EA68AA84 for ; Wed, 6 Oct 2021 13:14:17 +0300 (EEST) Received: by mail-pf1-f173.google.com with SMTP id 187so1915744pfc.10 for ; Wed, 06 Oct 2021 03:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=0oECgei4NlgbpT69yrK3ZkEZA3j9weJMP3F4o27rrA8=; b=CowearmPL5r1CP7fLmet4JqHtS0Cjs9kwmQflLhrH3Nv0RI9f83muOEXTGWWQZETAg xNBbRr/sd9eDUa66w1CM5eOBAYYzVKB67Ej6CNJbmqCoof3GYgy3NdQcgdvM7pPnUhkE 5qJOlmVXvPu/J3DZ8Rc6zVrXc513/rWcZLWfVC6pGt6/Bg7EET0sZ6lPqNcC1KG6Cmpu M2DtBxEqBRSA6+05/CArrzWReIjvChwTpQ067ktA5KZtBBrLX7+EhuA1IdFAnV+k+nAp TnlQMsQmIuh3kOr5qdKmgsAuaPt76XdYhpsLMMEoj2JDa729d6nZK+0oZ88k2/RuQw2S RExw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0oECgei4NlgbpT69yrK3ZkEZA3j9weJMP3F4o27rrA8=; b=XYB8kfd4MHOyyKlJVaGI6YN+pznc/+j8ZDLpRmzTJWY9RrdR2TI8y42pyrc+csyBot i4iLR8NOyKSmIonALfPAEDYWavkZlXKwWD11A/3kToRyYZ6cObMgJbYvFdirmrl1ruS8 E8o/W66jJuw3tBkJ8Zwm8NIY7E2+qkbVuHlyivora0z8R8uz1QM4Ti6Cxo2Ptc4XePnK k+azGQ5t8A3XyLIo47DRavZOPMDQzYvej/t8X3hS+7tupNoET1eiwJ3bG5iygUNtIl/m 21Uf6J9H4+sCnGVv0pLb6rEH3GUeArve71mUKJ5QQDDKWtv3iOi75JGjrRRovmnfOh87 mkJQ== X-Gm-Message-State: AOAM530IqtboePGLQ4crN59RVhK06ACmt5MNu93Ymb7Weh5mmubERy6M IESA+Uik/Uq3vQDKIZDz2nkW5MSRIFw= X-Received: by 2002:a63:470b:: with SMTP id u11mr7481896pga.441.1633515254895; Wed, 06 Oct 2021 03:14:14 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id i125sm20338309pfc.36.2021.10.06.03.14.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Oct 2021 03:14:14 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Wed, 6 Oct 2021 18:14:04 +0800 Message-Id: <1633515251-5156-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH 1/8] avcodec/bitpacked: check av_buffer_ref result 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: CeqQLS5F0cnq From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/bitpacked.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/bitpacked.c b/libavcodec/bitpacked.c index 8143151..0440df9 100644 --- a/libavcodec/bitpacked.c +++ b/libavcodec/bitpacked.c @@ -45,6 +45,10 @@ static int bitpacked_decode_uyvy422(AVCodecContext *avctx, AVFrame *frame, /* there is no need to copy as the data already match * a known pixel format */ frame->buf[0] = av_buffer_ref(avpkt->buf); + if (!frame->buf[0]) { + return AVERROR(ENOMEM); + } + ret = av_image_fill_arrays(frame->data, frame->linesize, avpkt->data, avctx->pix_fmt, avctx->width, avctx->height, 1); if (ret < 0) {