diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index f54dd8b..d79151d 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -93,7 +93,8 @@ ElfW(Shdr) *elfSection(Span<uint8_t> elf, ElfW(Ehdr) *eHdr, unsigned int idx)
 	if (idx >= eHdr->e_shnum)
 		return nullptr;
 
-	off_t offset = eHdr->e_shoff + idx * eHdr->e_shentsize;
+	off_t offset = eHdr->e_shoff + idx *
+				       static_cast<uint32_t>(eHdr->e_shentsize);
 	return elfPointer<ElfW(Shdr)>(elf, offset);
 }
 
