shithub: mp3dec

Download patch

ref: e4258fc1e8644d84267a44698c5be9882b3efc97
parent: dd063794986a1e6a23b6dc4dcdf95014e6c3df06
author: BogDan Vatra <bogdan@kdab.com>
date: Fri Nov 23 11:53:25 EST 2018

Fix crosses initialization of 'long int size'

.../minimp3_ex.h: In function 'int mp3dec_open_file(const char*, mp3dec_map_info_t*)':
.../minimp3_ex.h:329:1: error: jump to label 'error' [-fpermissive]
.../minimp3_ex.h:315:14: error:   from here [-fpermissive]
.../minimp3_ex.h:316:10: error:   crosses initialization of 'long int size'

--- a/minimp3_ex.h
+++ b/minimp3_ex.h
@@ -310,10 +310,10 @@
     FILE *file = fopen(file_name, "rb");
     if (!file)
         return -1;
-
+    long size = -1;
     if (fseek(file, 0, SEEK_END))
         goto error;
-    long size = ftell(file);
+    size = ftell(file);
     if (size < 0)
         goto error;
     map_info->size = (size_t)size;