Skip to content

Commit 523dc3d

Browse files
committed
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: <lieff/minimp3#125>. ........ git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@21447 56274372-70c3-4bfc-bfc3-4c3a0b034d27
1 parent 5ec92f1 commit 523dc3d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

include/minimp3/OpenMPT.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
minimp3 library from https://github.com/lieff/minimp3
2-
Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v2
3-
commit 30b5aea9b6d000f197798ddd44476b641a4d0ba7 (2024-08-15)
2+
Fork https://github.com/manxorist/minimp3/releases/tag/openmpt-2024-08-15-v3
3+
commit 2811a29e4115199209fe91ae5217c9c5fc611fa6 (2024-08-15)
44
The following changes have been made:
55
* minimp3.c has been added
66
* The following pull rquests have been merged:
77
* https://github.com/lieff/minimp3/pull/126
88
* https://github.com/lieff/minimp3/pull/96
99
* https://github.com/lieff/minimp3/pull/97
10+
* https://github.com/lieff/minimp3/pull/125
1011
* all modifications are marked by /* OpenMPT */

include/minimp3/minimp3.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,6 +1655,21 @@ static void mp3d_synth_granule(float *qmf_state, float *grbuf, int nbands, int n
16551655
}
16561656
}
16571657

1658+
static int hdr_is_tag(const uint8_t* hdr)
1659+
{
1660+
return hdr[0] == 'T' && hdr[1] == 'A' && hdr[2] == 'G' && hdr[3] == '\0';
1661+
}
1662+
1663+
static int hdr_is_null(const uint8_t* hdr)
1664+
{
1665+
return hdr[0] == '\0' && hdr[1] == '\0' && hdr[2] == '\0' && hdr[3] == '\0';
1666+
}
1667+
1668+
static int hdr_is_null_or_tag(const uint8_t* hdr)
1669+
{
1670+
return hdr_is_tag(hdr) > 0 || hdr_is_null(hdr) > 0;
1671+
}
1672+
16581673
static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes)
16591674
{
16601675
int i, nmatch;
@@ -1663,6 +1678,8 @@ static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes)
16631678
i += hdr_frame_bytes(hdr + i, frame_bytes) + hdr_padding(hdr + i);
16641679
if (i + HDR_SIZE > mp3_bytes)
16651680
return nmatch > 0;
1681+
if (hdr_is_null_or_tag(hdr + i))
1682+
return nmatch > 0;
16661683
if (!hdr_compare(hdr, hdr + i))
16671684
return 0;
16681685
}

0 commit comments

Comments
 (0)