|
|
|
@ -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) {
|
|
|
|
|