From 9c63ab99f0a505b0f60079bb30cc453b4415fddc Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Fri, 1 Sep 2017 22:33:39 +0200 Subject: Fix use of unitialized variables The second in my quest to make Godot 3.x compile with -Werror on GCC7 --- modules/squish/image_compress_squish.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/squish/image_compress_squish.cpp') diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index 29073a8499..072f18b990 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -91,7 +91,7 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { if (p_image->get_format() <= Image::FORMAT_RGBA8) { int squish_comp = squish::kColourRangeFit; - Image::Format target_format; + Image::Format target_format = Image::FORMAT_RGBA8; Image::DetectChannels dc = p_image->get_detected_channels(); @@ -140,6 +140,10 @@ void image_compress_squish(Image *p_image, Image::CompressSource p_source) { squish_comp |= squish::kDxt5; } break; + default: { + ERR_PRINT("Unknown image format, defaulting to RGBA8"); + break; + } } PoolVector data; -- cgit v1.2.3