shithub: mp3dec

Download patch

ref: a4ee3e04391431e651112edd3d4ddeddd9106e84
parent: 9719597ec6d609e5ea535172bde809be67ce1b5a
author: lieff <lieff@users.noreply.github.com>
date: Wed Feb 5 21:21:36 EST 2020

fix length test for seek at very end of file case

--- a/minimp3_test.c
+++ b/minimp3_test.c
@@ -180,7 +180,8 @@
         if (buf_ref)
         {
             size_t ref_samples = ref_size/2;
-            if (ref_samples != info.samples && (ref_samples + 1152) != info.samples && (ref_samples + 2304) != info.samples && 3 == info.layer)
+            if (((ref_samples != info.samples && (ref_samples + 1152) != info.samples && (ref_samples + 2304) != info.samples && 2 != mode) ||
+                (ref_samples > info.samples) || (ref_samples + 2304) < info.samples) && 3 == info.layer)
             {   /* some standard vectors are for some reason a little shorter */
                 printf("error: reference and produced number of samples do not match (%d/%d)\n", (int)ref_samples, (int)info.samples);
                 exit(1);