shithub: mp3dec

Download patch

ref: 7f0f0d0ced27567d04f0d831cbea513db0f28a48
parent: a4ee3e04391431e651112edd3d4ddeddd9106e84
author: lieff <lieff@users.noreply.github.com>
date: Wed Feb 5 21:22:41 EST 2020

mp3dec_ex: fix MP3D_SEEK_TO_BYTE seek mode

--- a/minimp3_ex.h
+++ b/minimp3_ex.h
@@ -418,9 +418,9 @@
     size_t i;
     if (MP3D_SEEK_TO_BYTE == dec->seek_method)
     {
-        dec->offset = position;
+        dec->offset = MINIMP3_MIN(position, dec->file.size);
         dec->cur_sample = 0;
-        return 0;
+        goto do_exit;
     }
     dec->cur_sample = position;
     position += dec->start_delay;