]> git.sesse.net Git - mlt/commitdiff
Fix bad stride in yuv422 due to non-even width requests.
authorDan Dennedy <dan@dennedy.org>
Mon, 26 Apr 2010 00:27:55 +0000 (17:27 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 26 Apr 2010 00:27:55 +0000 (17:27 -0700)
configure
src/modules/core/filter_resize.c

index e43774f3a4ec4e5372863f5d4cfc05ad85db56fc..6d90765f6506ed3c02dedd2689a10420a21be67a 100755 (executable)
--- 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()
index fc6cb1a3d73f9c6366c36be948cf7acc44688311..21334c83d405bd5e17465324711bc9beefdc898b 100644 (file)
@@ -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