diff options
Diffstat (limited to 'src/ipa/rpi/cam_helper/md_parser_smia.cpp')
-rw-r--r-- | src/ipa/rpi/cam_helper/md_parser_smia.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ipa/rpi/cam_helper/md_parser_smia.cpp b/src/ipa/rpi/cam_helper/md_parser_smia.cpp index 210787ed..c5b806d7 100644 --- a/src/ipa/rpi/cam_helper/md_parser_smia.cpp +++ b/src/ipa/rpi/cam_helper/md_parser_smia.cpp @@ -86,10 +86,13 @@ MdParserSmia::ParseStatus MdParserSmia::findRegs(libcamera::Span<const uint8_t> while (1) { int tag = buffer[currentOffset++]; - if ((bitsPerPixel_ == 10 && - (currentOffset + 1 - currentLineStart) % 5 == 0) || - (bitsPerPixel_ == 12 && - (currentOffset + 1 - currentLineStart) % 3 == 0)) { + /* Non-dummy bytes come in even-sized blocks: skip can only ever follow tag */ + while ((bitsPerPixel_ == 10 && + (currentOffset + 1 - currentLineStart) % 5 == 0) || + (bitsPerPixel_ == 12 && + (currentOffset + 1 - currentLineStart) % 3 == 0) || + (bitsPerPixel_ == 14 && + (currentOffset - currentLineStart) % 7 >= 4)) { if (buffer[currentOffset++] != RegSkip) return BadDummy; } |