shithub: mp3dec

Download patch

ref: a5bf79df79601fc1ec6eb885cce6f11a04733c99
parent: 7d78962e3677314c1f030ffbc8746650d059fd82
author: lieff <lieff@users.noreply.github.com>
date: Wed May 16 10:19:06 EDT 2018

fix coverity detected defect

--- a/minimp3_test.c
+++ b/minimp3_test.c
@@ -45,6 +45,8 @@
         return 0;
     fseek(file, 0, SEEK_END);
     *data_size = (int)ftell(file);
+    if (*data_size < 0)
+        return 0;
     fseek(file, 0, SEEK_SET);
     data = (unsigned char*)malloc(*data_size);
     if (!data)