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: 6221563553
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-05-06 (Mon, 06 May 2019)
This commit is contained in:
2019-05-06 19:31:39 +02:00
committed by vanhofen
parent 2b9aac368b
commit 5c02d6d61d

View File

@@ -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());