Skip to content

Commit

Permalink
fix the missing elemsize in vkimagemat from_android_hardware_buffer (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Dec 20, 2023
1 parent ded0b78 commit 6c261a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/mat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6c261a8

Please sign in to comment.