From bdeec820fb3434a90826ced9f3045852894e4367 Mon Sep 17 00:00:00 2001 From: Roberto Mariani Date: Mon, 3 Sep 2018 01:57:29 +0200 Subject: [PATCH] Check for !bAllocated on assignment of ofxCvImage (fixes #6115) --- addons/ofxOpenCv/src/ofxCvImage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ofxOpenCv/src/ofxCvImage.cpp b/addons/ofxOpenCv/src/ofxCvImage.cpp index ada6b970d70..6f3011e7b1e 100644 --- a/addons/ofxOpenCv/src/ofxCvImage.cpp +++ b/addons/ofxOpenCv/src/ofxCvImage.cpp @@ -230,7 +230,7 @@ void ofxCvImage::operator = ( const IplImage* mom ) { return; } - if( mom->nChannels == cvImage->nChannels && mom->depth == cvImage->depth ){ + if( !bAllocated || mom->nChannels == cvImage->nChannels && mom->depth == cvImage->depth ){ if( !bAllocated ){ //lets allocate if needed allocate(mom->width, mom->height); }else if( mom->width != width || mom->height != height ){