Fix harmless gcc warning about uninitialized mask in PNG saving code.

The mask was actually only used when it was initialized (or, conversely, the
mask was always initialized when it was used) but gcc doesn't seem to notice
this and still warns that mask components "may be used uninitialized in this
function".

Suppress the warnings by always initializing the mask, even if we don't use
it.

Closes #13333.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-07-19 22:36:00 +00:00
parent a09da78b03
commit 5568067a3d

View File

@ -795,15 +795,13 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
#endif
;
png_color_8 mask;
png_color_8 mask = { 0, 0, 0, 0, 0 };
if (bHasMask)
{
mask.red = image->GetMaskRed();
mask.green = image->GetMaskGreen();
mask.blue = image->GetMaskBlue();
mask.alpha = 0;
mask.gray = 0;
}
PaletteMap palette;