From bbbeaa14c34e11750b267b01198238d05705bd7e Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 1 Nov 2024 02:00:34 +0200 Subject: [PATCH] cdriso: missing null check --- libpcsxcore/cdriso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index 9b98fbe5..9282430f 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -1647,7 +1647,7 @@ int ISOreadTrack(const unsigned char *time, void *buf) ret = cdimg_read_func(cdHandle, 0, buf, sector); if (ret < 12*2 + 2048) { - if (multifile && sector >= msf2sec(ti[1].length)) { + if (buf && multifile && sector >= msf2sec(ti[1].length)) { // assume a gap not backed by a file memset(buf, 0, CD_FRAMESIZE_RAW); return 0; -- 2.39.5