From: Dan Dennedy Date: Mon, 26 Apr 2010 00:27:55 +0000 (-0700) Subject: Fix bad stride in yuv422 due to non-even width requests. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2e002de4ef091d49886892888b5c8b62cc9f9a8b;p=mlt Fix bad stride in yuv422 due to non-even width requests. --- diff --git a/configure b/configure index e43774f3..6d90765f 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh -export version=0.5.4 +export version=0.5.5 export soversion=2 show_help() diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index fc6cb1a3..21334c83 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -118,7 +118,7 @@ static void resize_image( uint8_t *output, int owidth, int oheight, uint8_t *inp while ( iheight -- ) { // We're in the input range for this row. - memcpy( out_line, in_line, iwidth * bpp ); + memcpy( out_line, in_line, istride ); // Move to next input line in_line += istride; @@ -257,6 +257,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_properties_set_int( properties, "resize_height", *height ); // Now get the image + if ( *format == mlt_image_yuv422 ) + owidth -= owidth % 2; error = mlt_frame_get_image( this, image, format, &owidth, &oheight, writable ); if ( error == 0 && *image ) @@ -308,6 +310,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * } else if ( strcmp( op, "none" ) != 0 ) { + *width = owidth; + *height = oheight; *image = frame_resize_image( this, *width, *height, bpp ); } else