changeset 8:5a1eec3c43cc

Get rid of indirect metadata variable sillyness in load_image().
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Dec 2016 14:04:58 +0200
parents 6dc09314d44b
children bfd933ef38b4
files bpgenc.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/bpgenc.c	Wed Dec 07 12:27:40 2016 +0200
+++ b/bpgenc.c	Wed Dec 07 14:04:58 2016 +0200
@@ -1541,7 +1541,6 @@
 {
     FILE *f;
     Image *img = NULL;
-    BPGMetaData *md;
     uint8_t buf[PROBE_BUF_SIZE];
 
     *pmd = NULL;
@@ -1555,17 +1554,16 @@
     fseek(f, 0, SEEK_SET);
 
     if (png_sig_cmp(buf, 0, PROBE_BUF_SIZE) == 0)
-        img = read_png(&md, f, color_space, bit_depth, limited_range, premultiplied_alpha);
+        img = read_png(pmd, f, color_space, bit_depth, limited_range, premultiplied_alpha);
     else
     if (memcmp(buf, PROBE_TIFF_MAGIC_LE, sizeof(PROBE_TIFF_MAGIC_LE)) == 0 ||
         memcmp(buf, PROBE_TIFF_MAGIC_BE, sizeof(PROBE_TIFF_MAGIC_BE)) == 0)
-        img = read_tiff(&md, infilename, color_space, bit_depth, limited_range, premultiplied_alpha);
+        img = read_tiff(pmd, infilename, color_space, bit_depth, limited_range, premultiplied_alpha);
     else
-        img = read_jpeg(&md, f, bit_depth);
+        img = read_jpeg(pmd, f, bit_depth);
 
 err:
     fclose(f);
-    *pmd = md;
     return img;
 }