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 2635843B90 for ; Tue, 19 Jul 2022 18:32:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CD0AA68B710; Tue, 19 Jul 2022 21:32:14 +0300 (EEST) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A05D168A6D0 for ; Tue, 19 Jul 2022 21:32:08 +0300 (EEST) Received: by mail-yb1-f170.google.com with SMTP id i14so28099948yba.1 for ; Tue, 19 Jul 2022 11:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=opjsXvAy2RhCEK/ODLAi1cUWKkgHSKJHi81jTPmtamQ=; b=ab53UUrRjVfd1E2KSorTFGt90rrZK9ZqehatnXbX21+YA9fv5SK7H3krXX3AAleoix 0r0QOIm4OlWLRPXWHGhzNmjJrEpdPwrV8Xtg6zEUID534F7nUm7jyEoldCcxwB+kiqG4 B5U8kOLXaTw9FCmk7SUgFde9CYtTavWQfus4zSPCd7Jhvc66i8Bmocx2IQnvfaJyjSx4 8PJjjNGUurtVGcQdIvCSxphrs/nJKL1Ip9emoSWWJivfsMgQCS481y4Vjiop4IrYMllw tblT3i4+gTGKSzB4UccZYSEtSC28TMKyD4dbyKXuWlFNRJtJek876tljUbmtS/X0esee D5NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=opjsXvAy2RhCEK/ODLAi1cUWKkgHSKJHi81jTPmtamQ=; b=kqCYh8/OnyNTAjuDSPSDfXzkz9O5DTtGttYsOFK1ZiMerzi8pndoJSSwDdl1+eH+Yi B6N7T+wWaOiqyOVTo2+364ERJ+7ZVP0MVIsCHTXmTvGmf0bWf4KRJ4EuDb4e+C24kYR7 SveXsBpD0LLgw8Q08khJXpgVJcF1cY5BIKm+WGw9jA/YNZLqNrpWBpBNm5oRLiYkLBPt EHMGAj0x5M4hcspaCNFQV3eJcn5REJiyPDmtFAbbtgiet7Iu2CPZ2cqzl6alRIU/hSR7 KzvvxoZ1pgZCGcU446Bohdr+P0GXte3T0bLQA3H8bM13QLq2DOIDUNnGFMxLMJki7HFw txsg== X-Gm-Message-State: AJIora89kUVhD4W+nKqp2nJzQJCdbnbiprk9gSiNp+Yc9kOXhXKTwj9y fBr0MMoW2x4JvV4Qz8rxrvnoYqW3W7R2x4bnGp8Oq8Plfu8= X-Google-Smtp-Source: AGRyM1vJA/A/AUUIBDiaop24l+Eyf9GqHVob1k5JnmovEUg0eEdZAl1+XbcpZnMJ6QcBLyKlfT0hWmU05UZR1Gf7LDI= X-Received: by 2002:a25:2e11:0:b0:665:746:6ac5 with SMTP id u17-20020a252e11000000b0066507466ac5mr32063423ybu.481.1658255526840; Tue, 19 Jul 2022 11:32:06 -0700 (PDT) MIME-Version: 1.0 References: <20220709035723.2035064-1-amirmazz@google.com> In-Reply-To: <20220709035723.2035064-1-amirmazz@google.com> From: Amir Mazzarella Date: Tue, 19 Jul 2022 11:31:56 -0700 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] Remove unsafe bitwise OR on FFVulkanExtensions enum 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: Ping On Fri, Jul 8, 2022 at 8:57 PM Amir Mazzarella wrote: > FFVulkanExtensions enum does not have a value for 0 defined, and bitwise > OR on enums is not safe. The function returns uint64_t, so it makes more > sense and is safer to do arithmetic in terms of uint64_t > > Signed-off-by: Amir Mazzarella > --- > libavutil/vulkan_loader.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h > index 3f1ee6aa46..0b2de4ab94 100644 > --- a/libavutil/vulkan_loader.h > +++ b/libavutil/vulkan_loader.h > @@ -50,12 +50,12 @@ static inline uint64_t ff_vk_extensions_to_mask(const > char * const *extensions, > #endif > }; > > - FFVulkanExtensions mask = 0x0; > + uint64_t mask = 0x0; > > for (int i = 0; i < nb_extensions; i++) { > for (int j = 0; j < FF_ARRAY_ELEMS(extension_map); j++) { > if (!strcmp(extensions[i], extension_map[j].name)) { > - mask |= extension_map[j].flag; > + mask |= (uint64_t) extension_map[j].flag; > continue; > } > } > -- > 2.37.0.rc0.161.g10f37bed90-goog > > _______________________________________________ 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".