From 8a65068f3bbc503ea67c8ec07c9a44a21a92f459 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 19 Jan 2024 14:16:52 -0800 Subject: [PATCH] clang-tidy: fix wrong cast Found with bugprone-misplaced-widening-cast Signed-off-by: Rosen Penev --- taglib/mpeg/xingheader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taglib/mpeg/xingheader.cpp b/taglib/mpeg/xingheader.cpp index e2bb7bed..b6100976 100644 --- a/taglib/mpeg/xingheader.cpp +++ b/taglib/mpeg/xingheader.cpp @@ -88,7 +88,7 @@ void MPEG::XingHeader::parse(const ByteVector &data) // Xing header found. - if(data.size() < static_cast(offset + 16)) { + if(data.size() < static_cast(offset) + 16) { debug("MPEG::XingHeader::parse() -- Xing header found but too short."); return; } @@ -112,7 +112,7 @@ void MPEG::XingHeader::parse(const ByteVector &data) // VBRI header found. - if(data.size() < static_cast(offset + 32)) { + if(data.size() < static_cast(offset) + 32) { debug("MPEG::XingHeader::parse() -- VBRI header found but too short."); return; }