summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDiegoisawesome <diego@domoreaweso.me>2020-02-18 22:11:04 -0800
committerDiegoisawesome <diego@domoreaweso.me>2020-02-18 22:11:04 -0800
commit059e5467f7395c125ec6dcc808b368a5a51feac9 (patch)
tree3bfe75813b5aa3cdfcb7337d8d91f57b883d6f67 /tools
parent57af90158dd1e4bd11b4ed040495e52f3ac0d74d (diff)
Add safety check
Diffstat (limited to 'tools')
-rw-r--r--tools/aif2pcm/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aif2pcm/main.c b/tools/aif2pcm/main.c
index 97180dfb5..714c71343 100644
--- a/tools/aif2pcm/main.c
+++ b/tools/aif2pcm/main.c
@@ -274,6 +274,11 @@ void read_aif(struct Bytes *aif, AifData *aif_data)
if (loop_type)
{
+ if (!markers)
+ {
+ FATAL_ERROR("INST chunk loop without MARK chunk in file!\n");
+ }
+
unsigned short marker_id = (aif->data[pos++] << 8);
marker_id |= (uint8_t)aif->data[pos++];