From: M. Yusuf Sarıgöz Date: Mon, 13 Nov 2023 15:20:52 +0000 (+0300) Subject: llava : fix regression for square images in #3613 (#4056) X-Git-Tag: upstream/0.0.4488~2974 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=bd90eca237b498dd106d315dcb9ad3e6fae3906f;p=pkg%2Fggml%2Fsources%2Fllama.cpp llava : fix regression for square images in #3613 (#4056) --- diff --git a/examples/llava/clip.cpp b/examples/llava/clip.cpp index c26ee495..fc0656c2 100644 --- a/examples/llava/clip.cpp +++ b/examples/llava/clip.cpp @@ -761,7 +761,7 @@ bool clip_image_preprocess(const clip_ctx * ctx, const clip_image_u8 * img, clip temp->ny = img->ny; temp->size = img->size; temp->data = new uint8_t[temp->size](); - *temp->data = *img->data; // copy + memcpy(&temp->data[0], &img->data[0], temp->size); // copy } const int nx = temp->nx;