Fix compiler warnings: clobber variables

This patchs fixes warnings generated by older toolchains:

shared/image-loader.c: In function 'load_png':
shared/image-loader.c:211:12: warning: variable 'data' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
  png_byte *data = NULL;

See https://linux.die.net/man/3/longjmp why is this needed.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
This commit is contained in:
Marius Vlad 2018-11-23 14:04:46 +02:00
parent 7d070ca0ba
commit 7a8a3a3547

View File

@ -208,8 +208,8 @@ load_png(FILE *fp)
{
png_struct *png;
png_info *info;
png_byte *data = NULL;
png_byte **row_pointers = NULL;
png_byte *volatile data = NULL;
png_byte **volatile row_pointers = NULL;
png_uint_32 width, height;
int depth, color_type, interlace, stride;
unsigned int i;