From 5c02d6d61d076e55e25b90e06cbf060034e6ca1a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 6 May 2019 19:31:39 +0200 Subject: [PATCH] movieinfo.cpp: exit loadFile() if st.size is 0 error message was: runtime error: variable length array bound evaluates to non-positive value 0 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6221563553e72e3a075f4b2232cb6e35c7205059 Author: Thilo Graf Date: 2019-05-06 (Mon, 06 May 2019) --- src/driver/movieinfo.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/driver/movieinfo.cpp b/src/driver/movieinfo.cpp index a214eb4c9..4ea268cb5 100644 --- a/src/driver/movieinfo.cpp +++ b/src/driver/movieinfo.cpp @@ -600,6 +600,10 @@ bool CMovieInfo::loadFile(CFile &file, std::string &buffer) close(fd); return false; } + + if (!st.st_size) + return false; + char buf[st.st_size]; if (st.st_size != read(fd, buf, st.st_size)) { TRACE("[mi] loadFile: cannot read (%s)\n", file.Name.c_str());