]> git.sesse.net Git - qscale/commitdiff
Fix a clone bug.
authorSteinar H. Gunderson <sesse@debian.org>
Sat, 12 Jul 2008 21:53:35 +0000 (23:53 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Sat, 12 Jul 2008 21:53:35 +0000 (23:53 +0200)
libqscale.c

index ab1936505cf27505efe4b48fc251acc0760b0c2f..dc040282001c74dd2fcdd644392d35a786902355 100644 (file)
@@ -500,11 +500,11 @@ qscale_img *qscale_clone(const qscale_img *img)
        }
        {
                dst->data_cb = (unsigned char *)malloc(dst->h1 * dstride1);
-               memcpy(dst->data_cb, img->data_cb, dst->h0 * dstride0);
+               memcpy(dst->data_cb, img->data_cb, dst->h1 * dstride1);
        }
        {
-               dst->data_cr = (unsigned char *)malloc(dst->h1 * dstride1);
-               memcpy(dst->data_cr, img->data_cr, dst->h0 * dstride0);
+               dst->data_cr = (unsigned char *)malloc(dst->h2 * dstride2);
+               memcpy(dst->data_cr, img->data_cr, dst->h2 * dstride2);
        }
 
        return dst;