Commit f57d6fbb authored by Natsuki Kawai's avatar Natsuki Kawai

Fixed a buffer overflow which occurs when setImage is called with different…

Fixed a buffer overflow which occurs when setImage is called with different images and default image_id.
parent 38dd47cf
......@@ -142,7 +142,7 @@ namespace cv {
Mat regions = regions_.getMat();
sizes = sizes_.getMat();
if (image_id != -1 && last_image_id != image_id) {
if (image_id == -1 || last_image_id != image_id) {
std::vector<Mat> img_planes;
split(img, img_planes);
......@@ -507,7 +507,7 @@ namespace cv {
Mat regions = regions_.getMat();
sizes = sizes_.getMat();
if (image_id != -1 && last_image_id != image_id) {
if (image_id == -1 || last_image_id != image_id) {
std::vector<Mat> img_planes;
split(img, img_planes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment