From: <sv...@op...> - 2024-08-15 14:43:52
|
Author: manx Date: Thu Aug 15 16:43:35 2024 New Revision: 21447 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21447 Log: Merged revision(s) 21446 from trunk/OpenMPT: [Var] minimp3: Update to fork <https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v3> commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15). This applies the following pull requests: <https://github.com/lieff/minimp3/pull/125>. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/include/minimp3/OpenMPT.txt branches/OpenMPT-1.31/include/minimp3/minimp3.h Modified: branches/OpenMPT-1.31/include/minimp3/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.31/include/minimp3/OpenMPT.txt Thu Aug 15 16:43:14 2024 (r21446) +++ branches/OpenMPT-1.31/include/minimp3/OpenMPT.txt Thu Aug 15 16:43:35 2024 (r21447) @@ -1,10 +1,11 @@ minimp3 library from https://github.com/lieff/minimp3 -Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v2 -commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15) +Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v3 +commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15) The following changes have been made: * minimp3.c has been added * The following pull rquests have been merged: * https://github.com/lieff/minimp3/pull/126 * https://github.com/lieff/minimp3/pull/96 * https://github.com/lieff/minimp3/pull/97 + * https://github.com/lieff/minimp3/pull/125 * all modifications are marked by /* OpenMPT */ Modified: branches/OpenMPT-1.31/include/minimp3/minimp3.h ============================================================================== --- branches/OpenMPT-1.31/include/minimp3/minimp3.h Thu Aug 15 16:43:14 2024 (r21446) +++ branches/OpenMPT-1.31/include/minimp3/minimp3.h Thu Aug 15 16:43:35 2024 (r21447) @@ -1655,6 +1655,21 @@ } } +static int hdr_is_tag(const uint8_t* hdr) +{ + return hdr[0] == 'T' && hdr[1] == 'A' && hdr[2] == 'G' && hdr[3] == '\0'; +} + +static int hdr_is_null(const uint8_t* hdr) +{ + return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\0' && hdr[3] == '\0'; +} + +static int hdr_is_null_or_tag(const uint8_t* hdr) +{ + return hdr_is_tag(hdr) > 0 || hdr_is_null(hdr) > 0; +} + static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes) { int i, nmatch; @@ -1663,6 +1678,8 @@ i += hdr_frame_bytes(hdr + i, frame_bytes) + hdr_padding(hdr + i); if (i + HDR_SIZE > mp3_bytes) return nmatch > 0; + if (hdr_is_null_or_tag(hdr + i)) + return nmatch > 0; if (!hdr_compare(hdr, hdr + i)) return 0; } |