From b7d51d51ec17a738cb455a82eec0fe49b857d4d0 Mon Sep 17 00:00:00 2001 From: maruncz Date: Mon, 4 Apr 2022 12:25:21 +0200 Subject: [PATCH] fix repeated branches --- src/librawspeed/decoders/RafDecoder.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/librawspeed/decoders/RafDecoder.cpp b/src/librawspeed/decoders/RafDecoder.cpp index afb2b04a4..b04b1655c 100644 --- a/src/librawspeed/decoders/RafDecoder.cpp +++ b/src/librawspeed/decoders/RafDecoder.cpp @@ -121,17 +121,14 @@ void RafDecoder::decodeRawInternal() { assert(!isCompressed()); - if (8UL * counts->getU32() >= 2UL * 16UL * width * height) { + if ((8UL * counts->getU32() >= 2UL * 16UL * width * height) + || (8UL * counts->getU32() >= 16UL * width * height)) { bps = 16; - } else if (8UL * counts->getU32() >= 2UL * 14UL * width * height) { + } else if ((8UL * counts->getU32() >= 2UL * 14UL * width * height) + || (8UL * counts->getU32() >= 14UL * width * height)) { bps = 14; - } else if (8UL * counts->getU32() >= 2UL * 12UL * width * height) { - bps = 12; - } else if (8UL * counts->getU32() >= 16UL * width * height) { - bps = 16; - } else if (8UL * counts->getU32() >= 14UL * width * height) { - bps = 14; - } else if (8UL * counts->getU32() >= 12UL * width * height) { + } else if ((8UL * counts->getU32() >= 2UL * 12UL * width * height) + || (8UL * counts->getU32() >= 12UL * width * height)) { bps = 12; } else { ThrowRDE("Can not detect bitdepth. StripByteCounts = %u, width = %u, "