From patchwork Tue Jun 8 13:45:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HouLei X-Patchwork-Id: 28169 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:b214:0:0:0:0:0 with SMTP id b20csp4417533iof; Tue, 8 Jun 2021 06:48:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjtJK3xGVGQHnKuWGJKe2s68fwb5a5vV2TprUarHcis2Bn7YyK1bTtT3qHYRObN9iGCCwm X-Received: by 2002:aa7:c54c:: with SMTP id s12mr13000074edr.374.1623160094849; Tue, 08 Jun 2021 06:48:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623160094; cv=none; d=google.com; s=arc-20160816; b=0zaiywUycrq54OzJbpNBIHKuq6LPolSc6Wb/apOLECzXO+iclUnWphg2FkVtltlNtK MEsKIL6KUZ6E0VjTb6Rfnv00OuBJVms/7tWRPZMo2EGSOr6VixcmUbyxNdrjvEMU5mXg WZtJQID37oaH8l51nsbl7BSLnYr0w31xOFz9gQZkBFpr0W7/8FqmXUfFS4fXxFOo64Tb +5vRHo7c3sFtosWDNfx0h2xa/czWirh+TAGjWf/TxDn78C7Nv0GNAWxhL5p+lbIOL6Ci dUoBjGZrBSyqBTsMigr9Sq6rMd03pkgxSva6yXZMy+nxhVODp8RkRzy63ZO1KmmGW5+W sY+A== 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:mime-version:message-id:date:to:from :delivered-to; bh=fCniPpHU5aqqu72MiImgRpUvgBFV+lBm0fqU7/vUt/E=; b=sYeKUw84ZVHh2LiWugGsRju4Zfx+39vLIJ0bWchzszWbc4o0M8fyfrxNsgk8vI2rrg Au/Z8uH+pnmjHhSbE33v+NqR1TP29+583jrprKWBb0e0Cw5Kmp4ctLElrZ12Tdtl/R5K CBVlce83GxWKSs4n/oZgfhNEdlFdS9I2vX/03Z3yCJjUQSy+OXnEfNz5jHTWrGavTe+L a45Hk/5nBVKGYMj5yzE7kVC9zXWEtxPOcxWG5ziMhwNmZY/Yn0UWmK2zmwyQNk+/QnRO RgBMtjMHNfBsGuw7MZIfznZE0gJpJDq9F75v0v11QpOBHZzieuzxxfztFBP2w7OwaLuh c7/g== 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 f8si15532196edk.566.2021.06.08.06.48.14; Tue, 08 Jun 2021 06:48:14 -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 B08A16808FC; Tue, 8 Jun 2021 16:48:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from lucky1.263xmail.com (lucky1.263xmail.com [211.157.147.130]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E05636802E0 for ; Tue, 8 Jun 2021 16:48:03 +0300 (EEST) Received: from localhost (unknown [192.168.167.235]) by lucky1.263xmail.com (Postfix) with ESMTP id 39B35D1AEB for ; Tue, 8 Jun 2021 21:45:42 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [119.4.240.125]) by smtp.263.net (postfix) whith ESMTP id P31747T140094935639808S1623159934934709_; Tue, 08 Jun 2021 21:45:42 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <634827180614067ecb6e21faeb3fdb4e> X-RL-SENDER: houlei@uniontech.com X-SENDER: houlei@uniontech.com X-LOGIN-NAME: houlei@uniontech.com X-FST-TO: ffmpeg-devel@ffmpeg.org X-RCPT-COUNT: 2 X-SENDER-IP: 119.4.240.125 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: houlei@uniontech.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Jun 2021 21:45:31 +0800 Message-Id: <20210608134531.32313-1-houlei@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] Fix memory allocation problem. Related to ticket #9264. 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: houlei@uniontech.com Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: EA3Pidnpb95n From: houlei Signed-off-by: houlei --- libavdevice/xv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavdevice/xv.c b/libavdevice/xv.c index 24ba3179f6..7e15c178b6 100644 --- a/libavdevice/xv.c +++ b/libavdevice/xv.c @@ -296,10 +296,11 @@ static int write_picture(AVFormatContext *s, uint8_t *input_data[4], { XVContext *xv = s->priv_data; XvImage *img = xv->yuv_image; - uint8_t *data[3] = { + uint8_t *data[4] = { img->data + img->offsets[0], img->data + img->offsets[1], - img->data + img->offsets[2] + img->data + img->offsets[2], + img->data + img->offsets[3] }; /* Check messages. Window might get closed. */