提交 50df9565 编写于 作者: A Alexander Shishkov

fixed #924

上级 f7866677
......@@ -1199,13 +1199,33 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
temp_image.width = width;
temp_image.height = height;
temp_image.cn = cn;
temp_image.data = malloc(temp_image.step*temp_image.height);
temp_image.data = (unsigned char*)malloc(temp_image.step*temp_image.height);
}
for( int y = 0; y < height; y++ )
memcpy(temp_image.data + y*temp_image.step, data + (height-1-y)*step, width*cn);
data = temp_image.data;
step = temp_image.step;
}
#else
if( width*cn != step )
{
if( !temp_image.data )
{
temp_image.step = width*cn;
temp_image.width = width;
temp_image.height = height;
temp_image.cn = cn;
temp_image.data = (unsigned char*)malloc(temp_image.step*temp_image.height);
}
if (origin == 1)
for( int y = 0; y < height; y++ )
memcpy(temp_image.data + y*temp_image.step, data + (height-1-y)*step, temp_image.step);
else
for( int y = 0; y < height; y++ )
memcpy(temp_image.data + y*temp_image.step, data + y*step, temp_image.step);
data = temp_image.data;
step = temp_image.step;
}
#endif
// check parameters
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册