mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #828 from kwagyeman/kwabena/handle_negative_bbp
Return 0 if bbp is less than 0
This commit is contained in:
commit
dac4c6e673
@ -236,6 +236,10 @@ void image_copy(image_t *dst, image_t *src)
|
||||
|
||||
size_t image_size(image_t *ptr)
|
||||
{
|
||||
if (ptr->bpp < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (ptr->bpp) {
|
||||
case IMAGE_BPP_BINARY: {
|
||||
return IMAGE_BINARY_LINE_LEN_BYTES(ptr) * ptr->h;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user