commit c6736a86a369d15e4ef806224651088c93c426ba
parent 4cbb1e2c86ec6532bcf51bd8bfebbe802c45cdf9
Author: Louis Burda <quent.burda@gmail.com>
Date: Fri, 13 Jan 2023 01:05:32 +0100
Assert filepath suffix since decoder doesnt error-out
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/mplay.c b/mplay.c
@@ -683,6 +683,9 @@ main(int argc, const char **argv)
if (!file) usage();
+ if (strlen(file) < 4 || strcmp(file + strlen(file) - 4, ".mp3"))
+ ERRX("Not a mp3 file");
+
audiofile.data = map_file(file, &audiofile.len);
decoder_init();