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 9071241A61 for ; Sun, 16 Jan 2022 00:59:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0698F68A990; Sun, 16 Jan 2022 02:59:55 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9C9E268073D for ; Sun, 16 Jan 2022 02:59:48 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3A8CBE6666 for ; Sun, 16 Jan 2022 01:59:48 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yDvghJnBHIK8 for ; Sun, 16 Jan 2022 01:59:44 +0100 (CET) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 158D8E65DA for ; Sun, 16 Jan 2022 01:59:44 +0100 (CET) Date: Sun, 16 Jan 2022 01:59:44 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Message-ID: <552433aa-e5a5-5821-fc10-3f5525ee468@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] AVFrame data alignment issues 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi, I wonder if there are strict requirements for alignment of AVFrame buffers. Yes, it is usually aligned by default, but there are filters, like crop or pad which tries to avoid copying data even at the cost of breaking the alignment. This unfortunately causes crashes for code which requires it, some examples: - the zscale filter only checks input buffer alignment but not output buffer alignment, therefore might crash if a later pad filter provides an unaligned get_buffer callback for a filter chain. - the blend/tblend filter has a similar problem, it's ASM code is using aligned movs for output. (not for input however). - the dnxhd encoder depends on aligment of its input buffers. How this should be fixed? - Change pad/crop filters to only do "smart" pad/crop if alignment can be guaranteed? Maybe a user option should be added to enable "unsafe" mode? - Add checks for aligment where it is actually required, e.g. in dnxhd encoder or blend/zscale filter? - Change blend code to use unaligned movs even for output? Thanks, Marton _______________________________________________ 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".