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 6E3DC41284 for ; Sun, 11 Sep 2022 07:51:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 306F968BAE4; Sun, 11 Sep 2022 10:51:24 +0300 (EEST) Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A6CB568B357 for ; Sun, 11 Sep 2022 10:51:18 +0300 (EEST) Received: from ursule.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id F1F08C001A; Sun, 11 Sep 2022 10:51:17 +0300 (EEST) Received: from [127.0.0.1] ([217.166.243.182]) by ursule.remlab.net with ESMTPSA id cY/BOXWTHWM9jAIAwZXkwQ (envelope-from ); Sun, 11 Sep 2022 10:51:17 +0300 Date: Sun, 11 Sep 2022 09:51:15 +0200 From: =?ISO-8859-1?Q?R=E9mi_Denis-Courmont?= To: FFmpeg development discussions and patches , Michael Niedermayer User-Agent: K-9 Mail for Android In-Reply-To: <20220910223046.5135-2-michael@niedermayer.cc> References: <20220910223046.5135-1-michael@niedermayer.cc> <20220910223046.5135-2-michael@niedermayer.cc> Message-ID: <0F896A11-EFBB-4635-A65E-285C45817BDB@remlab.net> MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 2/5] avcodec/dstdec: Check for overflow in build_filter() 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-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: Hi, Down-casting to a signed type (here, int16_t) is implementation-defined. And while normal compilers do the expected thing, with modulo-2^n complement, sanitizers tend to dislike it. AFAIK, the clean solution is via an union whence you assign the uint16_t member, and then read the int16_t member. Fortunately, GCC and LLVM are able to optimise that construct back to a single sign-extension. Br, _______________________________________________ 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".