]> granicus.if.org Git - openjpeg/commitdiff
src/bin/jpwl/convert.c pgxtoimage(): add missing fclose() (#977)
authorEven Rouault <even.rouault@spatialys.com>
Wed, 9 Aug 2017 07:50:39 +0000 (09:50 +0200)
committerEven Rouault <even.rouault@spatialys.com>
Wed, 9 Aug 2017 07:50:39 +0000 (09:50 +0200)
src/bin/jpwl/convert.c

index 7343528b689ea4d6d010417ab3d81923552c02d5..d0ec4bd05bfedfbf432ac9b88c019d75979f583f 100644 (file)
@@ -1352,6 +1352,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters)
                &endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {
         fprintf(stderr,
                 "ERROR: Failed to read the right number of element from the fscanf() function!\n");
+        fclose(f);
         return NULL;
     }
 
@@ -1371,6 +1372,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters)
         bigendian = 0;
     } else {
         fprintf(stderr, "Bad pgx header, please check input file\n");
+        fclose(f);
         return NULL;
     }