basic: Return error on unhandled image format (#1613)

Fail when an unhandled image format is encountered instead of
continuing validation with uninitialized variables.

Fixes a `-Wsometimes-uninitialized` warning for e.g. the `tolerance`
variable.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-01-11 10:25:30 +00:00
committed by GitHub
parent 4278d544dc
commit 896f43615d

View File

@@ -117,7 +117,8 @@ int validate_results( size_t width, size_t height, cl_image_format &format, char
} }
default: default:
// Should never get here // Should never get here
break; log_error("Unhandled channel data type\n");
return -1;
} }
if( format.image_channel_order == CL_BGRA ) if( format.image_channel_order == CL_BGRA )