From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6948640DA5 for ; Tue, 8 Feb 2022 05:48:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E338168AF04; Tue, 8 Feb 2022 07:48:17 +0200 (EET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86A6168AEC9 for ; Tue, 8 Feb 2022 07:48:11 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644299296; x=1675835296; h=from:to:cc:subject:date:message-id; bh=3aN0DKxY9lEPrpyGCyC6BrtCr2KcTN8Jj4pGWdNw+94=; b=mPPfCw7wMxQdq9JWB7XOh340W9gA4JRdW/6gwgtCwRjRKfbKHEvAjr+b 0JUfmp0Tk7VXGSM5+qT3i/FykvZ8HR1mZE9tY5u+H8gdJceiLS6RGCFLD 4wjTkimH2MCLybuQ/7sVKOFoedz0yL/2DelpILMsdoUMi19Z/LcdvGcEK sH5YqMlYpEm0RjxAe3xqqpsctIGG+73JQniGrdPwIKDMfxn3i1oRYTjtL OeKUakKzxbP2zv0corZPDCRUucr2PHEtam6uiH194k9TW9anwGUq3MFAm WvUhUCzW2xjhqw30Ez6t26h5PrIg8HJ8c9Nfahod+e1MGpm7pE2TWxdIc A==; X-IronPort-AV: E=McAfee;i="6200,9189,10251"; a="248642496" X-IronPort-AV: E=Sophos;i="5.88,351,1635231600"; d="scan'208";a="248642496" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 21:48:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,351,1635231600"; d="scan'208";a="540451075" Received: from xhh-dg164.sh.intel.com ([10.239.159.167]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 21:48:08 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Feb 2022 13:47:34 +0800 Message-Id: <20220208054734.14166-1-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] lavu/fifo: fix regression 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: Haihao Xiang MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Haihao Xiang offset_w might be updated after growing the FIFO Fix ticket #9630 Tested-by: U. Artie Eoff Reviewed-by: mkver Reviewed-by: U. Artie Eoff Signed-off-by: Haihao Xiang --- libavutil/fifo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 0af0154945..02e0ec3f0d 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -147,13 +147,15 @@ static int fifo_write_common(AVFifo *f, const uint8_t *buf, size_t *nb_elems, AVFifoCB read_cb, void *opaque) { size_t to_write = *nb_elems; - size_t offset_w = f->offset_w; + size_t offset_w; int ret = 0; ret = fifo_check_space(f, to_write); if (ret < 0) return ret; + offset_w = f->offset_w; + while (to_write > 0) { size_t len = FFMIN(f->nb_elems - offset_w, to_write); uint8_t *wptr = f->buffer + offset_w * f->elem_size; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".