Bugfix: Bitmap ctor throws an exception if we attempt to create an empty bitmap (0, 0).

This commit is contained in:
Peter Rekdal Sunde
2015-07-22 09:43:53 +02:00
parent f8abdf2a6f
commit dda263edb2

View File

@@ -50,6 +50,11 @@ namespace openalprnet
static Bitmap^ MatToBitmap(cv::Mat mat) static Bitmap^ MatToBitmap(cv::Mat mat)
{ {
if (mat.empty())
{
return nullptr;
}
const int width = mat.size().width; const int width = mat.size().width;
const int height = mat.size().height; const int height = mat.size().height;
const int channels = mat.channels(); const int channels = mat.channels();