From: Steinar H. Gunderson Date: Sat, 12 Jul 2008 21:53:35 +0000 (+0200) Subject: Fix a clone bug. X-Git-Url: https://git.sesse.net/?p=qscale;a=commitdiff_plain;h=183d583f01d53c8bf9093ccf2c80d200f4beba06 Fix a clone bug. --- diff --git a/libqscale.c b/libqscale.c index ab19365..dc04028 100644 --- a/libqscale.c +++ b/libqscale.c @@ -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;