From 0ecdc522ea0d08e5131ecc2082c999b760874718 Mon Sep 17 00:00:00 2001 From: mpromonet Date: Sun, 5 Feb 2023 16:03:39 +0100 Subject: [PATCH] add debug log for dqt parsing --- src/MJPEGVideoSource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MJPEGVideoSource.cpp b/src/MJPEGVideoSource.cpp index c35a080..4a85f8a 100644 --- a/src/MJPEGVideoSource.cpp +++ b/src/MJPEGVideoSource.cpp @@ -51,11 +51,12 @@ void MJPEGVideoSource::afterGettingFrame(unsigned frameSize,unsigned numTruncate int qtable_length = length-2; unsigned int qtable_position = i+4; while (qtable_length > 0) { + LOG(DEBUG) << "DQT qtable_length:" << qtable_length; unsigned int precision = (fTo[qtable_position]&0xf0)<<4; unsigned int quantIdx = fTo[qtable_position]&0x0f; unsigned int quantSize = 64*(precision+1); if (quantSize*quantIdx+quantSize <= sizeof(m_qTable)) { - if ( (i+2+length) < frameSize) { + if ( (qtable_position+quantSize) < frameSize) { memcpy(m_qTable + quantSize*quantIdx, fTo + qtable_position + 1, quantSize); LOG(DEBUG) << "Quantization table idx:" << quantIdx << " precision:" << precision << " size:" << quantSize << " total size:" << m_qTableSize; if (quantSize*quantIdx+quantSize > m_qTableSize) {