Closed bluk closed 8 years ago
In very odd but numerous crash reports, there are instances where the IplImage does not have a valid header. This could cause a crash notably calling through (reversed stack trace):
[CardIOVideoStream sendFrameToDelegate:] [CardIOCameraView videoStream:didProcessFrame:] [CardIOView videoStream:didProcessFrame:] [CardIOView didScanCard:] [CardIOVideoFrame imageWithGrayscale:] [CardIOIplImage rgbImageWithY:cb:cr:] void dmz_YCbCr_to_RGB(IplImage *y, IplImage *cb, IplImage *cr, IplImage **rgb)
and eventually calls cvGetSize() which throws an exception with "Array should be CvMat or IplImage".
cvGetSize()
This code tries to detect invalid IplImage values earlier and skips scanning them.
Looks reasonable to me! :shipit:
In very odd but numerous crash reports, there are instances where the IplImage does not have a valid header. This could cause a crash notably calling through (reversed stack trace):
and eventually calls
cvGetSize()
which throws an exception with "Array should be CvMat or IplImage".This code tries to detect invalid IplImage values earlier and skips scanning them.