From 4949c6ded8e8292715db77357d9d302f45c892b2 Mon Sep 17 00:00:00 2001 From: Lode Vandevenne Date: Mon, 11 Apr 2016 15:03:41 +0200 Subject: fix coding error --- lodepng.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lodepng.cpp b/lodepng.cpp index 983ecbd..59e3af9 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -4506,6 +4506,7 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, ucvector scanlines; size_t predict; size_t numpixels; + size_t outsize; /*for unknown chunk order*/ unsigned unknown = 0; @@ -4683,7 +4684,7 @@ static void decodeGeneric(unsigned char** out, unsigned* w, unsigned* h, if(!state->error) { - size_t outsize = lodepng_get_raw_size(*w, *h, &state->info_png.color); + outsize = lodepng_get_raw_size(*w, *h, &state->info_png.color); *out = (unsigned char*)lodepng_malloc(outsize); if(!*out) state->error = 83; /*alloc fail*/ } -- cgit v1.2.3