fixed memory corruption in cvtest::copyMakeBorder (thanks to Pieter-Jan Busschaert)
authorVadim Pisarevsky <no@email>
Thu, 17 Feb 2011 09:07:55 +0000 (09:07 +0000)
committerVadim Pisarevsky <no@email>
Thu, 17 Feb 2011 09:07:55 +0000 (09:07 +0000)
modules/ts/src/ts_func.cpp

index 5ad45f1..59d1163 100644 (file)
@@ -900,7 +900,7 @@ void copyMakeBorder(const Mat& src, Mat& dst, int top, int bottom, int left, int
     }
     else
     {
-        vector<int> tabvec((left + right)*esz);
+        vector<int> tabvec((left + right)*esz + 1);
         int* ltab = &tabvec[0];
         int* rtab = &tabvec[left*esz];
         for( i = 0; i < left; i++ )