From 6c261a8c04cb62b9ca429fdbf7b8df65f670b4f9 Mon Sep 17 00:00:00 2001 From: nihui Date: Wed, 20 Dec 2023 13:54:47 +0800 Subject: [PATCH] fix the missing elemsize in vkimagemat from_android_hardware_buffer (#5237) --- src/mat.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mat.cpp b/src/mat.cpp index a1777b4bebc..bd75ec2301b 100644 --- a/src/mat.cpp +++ b/src/mat.cpp @@ -1218,8 +1218,9 @@ VkImageMat VkImageMat::from_android_hardware_buffer(VkAndroidHardwareBufferImage { int width = allocator->width(); int height = allocator->height(); + size_t elemsize = 4u; // elemsize for ahb is actually just a placeholder - return VkImageMat(width, height, allocator); + return VkImageMat(width, height, elemsize, allocator); } #endif // __ANDROID_API__ >= 26 #endif // NCNN_PLATFORM_API