From 22927ff12192f836a7e6f3731ee7c317928b7d7f Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 13 Jun 2011 21:20:38 +0000 Subject: [PATCH] fixed ticket #983 --- modules/python/src1/cv.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/python/src1/cv.cpp b/modules/python/src1/cv.cpp index ae75e0acdb..dea8015bd9 100644 --- a/modules/python/src1/cv.cpp +++ b/modules/python/src1/cv.cpp @@ -2616,11 +2616,12 @@ static PyObject *FROM_CvRNG(CvRNG r) static PyObject *FROM_generic(generic r) { - CvTypeInfo* t = cvTypeOf(r); if (r == NULL) { failmsg("OpenCV returned NULL"); return NULL; - } if (strcmp(t->type_name, "opencv-image") == 0) + } + CvTypeInfo* t = cvTypeOf(r); + if (strcmp(t->type_name, "opencv-image") == 0) return FROM_IplImagePTR((IplImage*)r); else if (strcmp(t->type_name, "opencv-matrix") == 0) return FROM_CvMat((CvMat*)r);