From 488e54fed2bc5a04b177a6d69435da0be3273124 Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:22:54 +0200 Subject: [PATCH] Update combine_image.cpp --- src/gfx/combine_image.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gfx/combine_image.cpp b/src/gfx/combine_image.cpp index a1e2ff96..5aa9376e 100644 --- a/src/gfx/combine_image.cpp +++ b/src/gfx/combine_image.cpp @@ -107,12 +107,8 @@ void combine_image_do(Image& a, Image b) { void combine_image(Image& a, const Image& b, ImageCombine combine) { // Images must have same size - assert(a.GetWidth() == b.GetWidth()); - assert(a.GetHeight() == b.GetHeight()); - // Copy alpha channel? - if (b.HasAlpha()) { - if (!a.HasAlpha()) a.InitAlpha(); - memcpy(a.GetAlpha(), b.GetAlpha(), a.GetWidth() * a.GetHeight()); + if (a.GetWidth() != b.GetWidth() || a.GetHeight() != b.GetHeight()) { + throw Error(_ERROR_("images used for combine blending must have the same size")); } // Combine image data, by dispatching to combineImageDo switch(combine) {