Bug Summary

File:root/firefox-clang/third_party/dav1d/src/wedge.h
Warning:line 33, column 9
Excessive padding in 'Dav1dMasks' (104 padding bytes, where 40 is optimal). Optimal fields order: ii_nondc_8x8, ii_nondc_4x16, ii_nondc_8x16, wedge_420_4x4, ii_nondc_16x16, ii_nondc_8x32, wedge_444_8x8, wedge_422_4x8, wedge_420_8x4, wedge_420_4x8, ii_dc, ii_nondc_16x32, wedge_444_16x8, wedge_444_8x16, wedge_422_8x8, wedge_422_4x16, wedge_420_16x4, wedge_420_8x8, wedge_420_4x16, ii_nondc_32x32, wedge_444_32x8, wedge_444_16x16, wedge_444_8x32, wedge_422_16x8, wedge_422_8x16, wedge_422_4x32, wedge_420_16x8, wedge_420_8x16, wedge_444_32x16, wedge_444_16x32, wedge_422_16x16, wedge_422_8x32, wedge_420_16x16, wedge_444_32x32, wedge_422_16x32, ii_nondc_4x8, ii_nondc_4x4, offsets, consider reordering the fields or adding explicit padding members

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -O2 -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name lib.c -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/media/libdav1d -fcoverage-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/media/libdav1d -resource-dir /usr/lib/llvm-23/lib/clang/23 -include /root/firefox-clang/config/gcc_hidden.h -include /root/firefox-clang/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D DAV1D_API= -D STACK_ALIGNMENT=16 -D MOZ_HAS_MOZGLUE -D MOZILLA_INTERNAL_API -D IMPL_LIBXUL -D MOZ_SUPPORT_LEAKCHECKING -D STATIC_EXPORTABLE_JS_API -I /root/firefox-clang/media/libdav1d -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/media/libdav1d -I /root/firefox-clang/third_party/dav1d -I /root/firefox-clang/third_party/dav1d/include -I /root/firefox-clang/third_party/dav1d/include/dav1d -I /root/firefox-clang/third_party/dav1d/src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/llvm-23/lib/clang/23/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/16/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-error=tautological-type-limit-compare -Wno-range-loop-analysis -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-unknown-warning-option -Wno-character-conversion -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fdiagnostics-absolute-paths -vectorize-loops -vectorize-slp -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -mllvm -dwarf-linkage-names=Abstract -faddrsig -fdwarf2-cfi-asm -o /tmp/scan-build-2026-09-01-224014-2642839-1 -x c /root/firefox-clang/third_party/dav1d/src/lib.c
1/*
2 * Copyright © 2018, VideoLAN and dav1d authors
3 * Copyright © 2018, Two Orioles, LLC
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright notice, this
10 * list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright notice,
13 * this list of conditions and the following disclaimer in the documentation
14 * and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef DAV1D_SRC_WEDGE_H
29#define DAV1D_SRC_WEDGE_H
30
31#include "src/levels.h"
32
33typedef struct {
Excessive padding in 'Dav1dMasks' (104 padding bytes, where 40 is optimal). Optimal fields order: ii_nondc_8x8, ii_nondc_4x16, ii_nondc_8x16, wedge_420_4x4, ii_nondc_16x16, ii_nondc_8x32, wedge_444_8x8, wedge_422_4x8, wedge_420_8x4, wedge_420_4x8, ii_dc, ii_nondc_16x32, wedge_444_16x8, wedge_444_8x16, wedge_422_8x8, wedge_422_4x16, wedge_420_16x4, wedge_420_8x8, wedge_420_4x16, ii_nondc_32x32, wedge_444_32x8, wedge_444_16x16, wedge_444_8x32, wedge_422_16x8, wedge_422_8x16, wedge_422_4x32, wedge_420_16x8, wedge_420_8x16, wedge_444_32x16, wedge_444_16x32, wedge_422_16x16, wedge_422_8x32, wedge_420_16x16, wedge_444_32x32, wedge_422_16x32, ii_nondc_4x8, ii_nondc_4x4, offsets, consider reordering the fields or adding explicit padding members
34 /* Offsets, in units of 8 bytes, relative to the start of the struct. */
35 struct {
36 uint16_t wedge[2 /* sign */][16 /* wedge_idx */];
37 uint16_t ii[N_INTER_INTRA_PRED_MODES];
38 } offsets[3 /* 444, 422, 420 */][BS_8x8 - BS_32x32 + 1];
39
40 uint8_t ALIGN(wedge_444_32x32[ 16 * 32 * 32], 64)wedge_444_32x32[ 16 * 32 * 32] __attribute__((aligned(64)));
41 uint8_t ALIGN(wedge_444_32x16[ 16 * 32 * 16], 64)wedge_444_32x16[ 16 * 32 * 16] __attribute__((aligned(64)));
42 uint8_t ALIGN(wedge_444_32x8 [ 16 * 32 * 8], 64)wedge_444_32x8 [ 16 * 32 * 8] __attribute__((aligned(64)));
43 uint8_t ALIGN(wedge_444_16x32[ 16 * 16 * 32], 64)wedge_444_16x32[ 16 * 16 * 32] __attribute__((aligned(64)));
44 uint8_t ALIGN(wedge_444_16x16[ 16 * 16 * 16], 64)wedge_444_16x16[ 16 * 16 * 16] __attribute__((aligned(64)));
45 uint8_t ALIGN(wedge_444_16x8 [ 16 * 16 * 8], 64)wedge_444_16x8 [ 16 * 16 * 8] __attribute__((aligned(64)));
46 uint8_t ALIGN(wedge_444_8x32 [ 16 * 8 * 32], 64)wedge_444_8x32 [ 16 * 8 * 32] __attribute__((aligned(64)));
47 uint8_t ALIGN(wedge_444_8x16 [ 16 * 8 * 16], 64)wedge_444_8x16 [ 16 * 8 * 16] __attribute__((aligned(64)));
48 uint8_t ALIGN(wedge_444_8x8 [ 16 * 8 * 8], 64)wedge_444_8x8 [ 16 * 8 * 8] __attribute__((aligned(64)));
49
50 uint8_t ALIGN(wedge_422_16x32[2 * 16 * 16 * 32], 64)wedge_422_16x32[2 * 16 * 16 * 32] __attribute__((aligned(64))
)
;
51 uint8_t ALIGN(wedge_422_16x16[2 * 16 * 16 * 16], 64)wedge_422_16x16[2 * 16 * 16 * 16] __attribute__((aligned(64))
)
;
52 uint8_t ALIGN(wedge_422_16x8 [2 * 16 * 16 * 8], 64)wedge_422_16x8 [2 * 16 * 16 * 8] __attribute__((aligned(64)));
53 uint8_t ALIGN(wedge_422_8x32 [2 * 16 * 8 * 32], 64)wedge_422_8x32 [2 * 16 * 8 * 32] __attribute__((aligned(64)));
54 uint8_t ALIGN(wedge_422_8x16 [2 * 16 * 8 * 16], 64)wedge_422_8x16 [2 * 16 * 8 * 16] __attribute__((aligned(64)));
55 uint8_t ALIGN(wedge_422_8x8 [2 * 16 * 8 * 8], 64)wedge_422_8x8 [2 * 16 * 8 * 8] __attribute__((aligned(64)));
56 uint8_t ALIGN(wedge_422_4x32 [2 * 16 * 4 * 32], 64)wedge_422_4x32 [2 * 16 * 4 * 32] __attribute__((aligned(64)));
57 uint8_t ALIGN(wedge_422_4x16 [2 * 16 * 4 * 16], 64)wedge_422_4x16 [2 * 16 * 4 * 16] __attribute__((aligned(64)));
58 uint8_t ALIGN(wedge_422_4x8 [2 * 16 * 4 * 8], 64)wedge_422_4x8 [2 * 16 * 4 * 8] __attribute__((aligned(64)));
59
60 uint8_t ALIGN(wedge_420_16x16[2 * 16 * 16 * 16], 64)wedge_420_16x16[2 * 16 * 16 * 16] __attribute__((aligned(64))
)
;
61 uint8_t ALIGN(wedge_420_16x8 [2 * 16 * 16 * 8], 64)wedge_420_16x8 [2 * 16 * 16 * 8] __attribute__((aligned(64)));
62 uint8_t ALIGN(wedge_420_16x4 [2 * 16 * 16 * 4], 64)wedge_420_16x4 [2 * 16 * 16 * 4] __attribute__((aligned(64)));
63 uint8_t ALIGN(wedge_420_8x16 [2 * 16 * 8 * 16], 64)wedge_420_8x16 [2 * 16 * 8 * 16] __attribute__((aligned(64)));
64 uint8_t ALIGN(wedge_420_8x8 [2 * 16 * 8 * 8], 64)wedge_420_8x8 [2 * 16 * 8 * 8] __attribute__((aligned(64)));
65 uint8_t ALIGN(wedge_420_8x4 [2 * 16 * 8 * 4], 64)wedge_420_8x4 [2 * 16 * 8 * 4] __attribute__((aligned(64)));
66 uint8_t ALIGN(wedge_420_4x16 [2 * 16 * 4 * 16], 64)wedge_420_4x16 [2 * 16 * 4 * 16] __attribute__((aligned(64)));
67 uint8_t ALIGN(wedge_420_4x8 [2 * 16 * 4 * 8], 64)wedge_420_4x8 [2 * 16 * 4 * 8] __attribute__((aligned(64)));
68 uint8_t ALIGN(wedge_420_4x4 [2 * 16 * 4 * 4], 64)wedge_420_4x4 [2 * 16 * 4 * 4] __attribute__((aligned(64)));
69
70 uint8_t ALIGN(ii_dc [ 32 * 32], 64)ii_dc [ 32 * 32] __attribute__((aligned(64)));
71 uint8_t ALIGN(ii_nondc_32x32[3 * 32 * 32], 64)ii_nondc_32x32[3 * 32 * 32] __attribute__((aligned(64)));
72 uint8_t ALIGN(ii_nondc_16x32[3 * 16 * 32], 64)ii_nondc_16x32[3 * 16 * 32] __attribute__((aligned(64)));
73 uint8_t ALIGN(ii_nondc_16x16[3 * 16 * 16], 64)ii_nondc_16x16[3 * 16 * 16] __attribute__((aligned(64)));
74 uint8_t ALIGN(ii_nondc_8x32 [3 * 8 * 32], 64)ii_nondc_8x32 [3 * 8 * 32] __attribute__((aligned(64)));
75 uint8_t ALIGN(ii_nondc_8x16 [3 * 8 * 16], 64)ii_nondc_8x16 [3 * 8 * 16] __attribute__((aligned(64)));
76 uint8_t ALIGN(ii_nondc_8x8 [3 * 8 * 8], 64)ii_nondc_8x8 [3 * 8 * 8] __attribute__((aligned(64)));
77 uint8_t ALIGN(ii_nondc_4x16 [3 * 4 * 16], 64)ii_nondc_4x16 [3 * 4 * 16] __attribute__((aligned(64)));
78 uint8_t ALIGN(ii_nondc_4x8 [3 * 4 * 8], 32)ii_nondc_4x8 [3 * 4 * 8] __attribute__((aligned(32)));
79 uint8_t ALIGN(ii_nondc_4x4 [3 * 4 * 4], 16)ii_nondc_4x4 [3 * 4 * 4] __attribute__((aligned(16)));
80} Dav1dMasks;
81
82#define II_MASK(c, bs, b)((const uint8_t*)((uintptr_t)&dav1d_masks + (size_t)((b)->
interintra_type == INTER_INTRA_BLEND ? dav1d_masks.offsets[c]
[(bs)-BS_32x32].ii[(b)->interintra_mode] : dav1d_masks.offsets
[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
\
83 ((const uint8_t*)((uintptr_t)&dav1d_masks + \
84 (size_t)((b)->interintra_type == INTER_INTRA_BLEND ? \
85 dav1d_masks.offsets[c][(bs)-BS_32x32].ii[(b)->interintra_mode] : \
86 dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[0][(b)->wedge_idx]) * 8))
87
88#define WEDGE_MASK(c, bs, sign, idx)((const uint8_t*)((uintptr_t)&dav1d_masks + (size_t)dav1d_masks
.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
\
89 ((const uint8_t*)((uintptr_t)&dav1d_masks + \
90 (size_t)dav1d_masks.offsets[c][(bs)-BS_32x32].wedge[sign][idx] * 8))
91
92EXTERNextern __attribute__((visibility("hidden"))) Dav1dMasks dav1d_masks;
93
94void dav1d_init_ii_wedge_masks(void);
95
96#endif /* DAV1D_SRC_WEDGE_H */