From: Alexander Alekhin Date: Thu, 1 Dec 2016 12:24:36 +0000 (+0300) Subject: videoio: images: fix buffer overflow problem X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1383^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c560ff23ade974d3d365bf4c2f14c2fc39025765;p=platform%2Fupstream%2Fopencv.git videoio: images: fix buffer overflow problem --- diff --git a/modules/videoio/src/cap_images.cpp b/modules/videoio/src/cap_images.cpp index 922a576..4554186 100644 --- a/modules/videoio/src/cap_images.cpp +++ b/modules/videoio/src/cap_images.cpp @@ -345,7 +345,10 @@ bool CvVideoWriter_Images::writeFrame( const IplImage* image ) { char str[_MAX_PATH]; sprintf(str, filename, currentframe); - int ret = cvSaveImage(str, image, ¶ms[0]); + std::vector image_params = params; + image_params.push_back(0); // append parameters 'stop' mark + image_params.push_back(0); + int ret = cvSaveImage(str, image, &image_params[0]); currentframe++;