Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

thanks for editing, definitely helpful.

i found 2 buffer overflows there, both the same kind:

you load your img as grayscale, 8 bit, then you pass it to mv_background_average(), and there access it as ushort:

ushort *  data = img.ptr<ushort>(i);

make it :

uchar *  data = img.ptr<uchar>(i);

instead.

same for the similar call in mv_background_rotation()

( and where's the "double-linked list" ? )

thanks for editing, definitely helpful.

i found 2 buffer overflows there, both the same kind:

you load your img as grayscale, 8 bit, then you pass it to mv_background_average(), and there access it as ushort:

ushort *  data = img.ptr<ushort>(i);
img.ptr<ushort>(i); 
// since a ushort is twice as big as a uchar, you'll get wrong values *and* overflow

make it :

uchar *  data = img.ptr<uchar>(i);

instead.

same for the similar call in mv_background_rotation()

( and where's the "double-linked list" ? )