File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -634,6 +634,23 @@ bool Jpeg2KOpjDecoder::readData( Mat& img )
634
634
cv::format (" OpenJPEG2000: output precision > 16 not supported: target depth %d" , depth));
635
635
}();
636
636
const uint8_t shift = outPrec > m_maxPrec ? 0 : (uint8_t )(m_maxPrec - outPrec); // prec <= 64
637
+
638
+ const int inChannels = image_->numcomps ;
639
+
640
+ CV_Assert (inChannels > 0 );
641
+ CV_Assert (image_->comps );
642
+ for (int c = 0 ; c < inChannels; c++)
643
+ {
644
+ const opj_image_comp_t & comp = image_->comps [c];
645
+ CV_CheckEQ ((int )comp.dx , 1 , " OpenJPEG2000: tiles are not supported" );
646
+ CV_CheckEQ ((int )comp.dy , 1 , " OpenJPEG2000: tiles are not supported" );
647
+ CV_CheckEQ ((int )comp.x0 , 0 , " OpenJPEG2000: tiles are not supported" );
648
+ CV_CheckEQ ((int )comp.y0 , 0 , " OpenJPEG2000: tiles are not supported" );
649
+ CV_CheckEQ ((int )comp.w , img.cols , " OpenJPEG2000: tiles are not supported" );
650
+ CV_CheckEQ ((int )comp.h , img.rows , " OpenJPEG2000: tiles are not supported" );
651
+ CV_Assert (comp.data && " OpenJPEG2000: missing component data (unsupported / broken input)" );
652
+ }
653
+
637
654
return decode (*image_, img, shift);
638
655
}
639
656
You can’t perform that action at this time.
0 commit comments