CPU (Linux): prevents variables from integer overflow

This commit is contained in:
Carter Li
2025-12-11 09:50:35 +08:00
parent 6e7b4bab75
commit f2a29309f3
+2 -2
View File
@@ -862,9 +862,9 @@ FF_MAYBE_UNUSED static uint16_t getLoongarchPropCount(FFstrbuf* cpuinfo, const c
char* pend;
unsigned long id = strtoul(p, &pend, 10);
if (__builtin_expect(id > 64, false))
high |= 1 << (id - 64);
high |= 1UL << (id - 64);
else
low |= 1 << id;
low |= 1UL << id;
p = pend;
}