From d4d292434c430a780c9614c04578d0cf1b7d1fba Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sat, 7 Jan 2023 18:26:09 +0900 Subject: [PATCH] Add error checking for movie format AliceSoft only uses MPEG-PS, but PlayMovie.dll is included in System4 SDK and can play any format supported by DirectShow. This fixes crash in movie_load() when given file is not a MPEG-PS. --- src/movie.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/movie.c b/src/movie.c index 800892d..42393fa 100644 --- a/src/movie.c +++ b/src/movie.c @@ -115,6 +115,12 @@ struct movie_context *movie_load(const char *filename) movie_free(mc); return NULL; } + if (!plm_has_headers(mc->plm)) { + WARNING("%s: not a MPEG-PS file", path); + free(path); + movie_free(mc); + return NULL; + } free(path); if (!movie_shader.program)