From 19ebb61bf92262dc1868de10ba5a211db249ce76 Mon Sep 17 00:00:00 2001 From: Stas'M Date: Thu, 4 Oct 2018 00:18:32 +0300 Subject: [PATCH] FMOPL: Avoid double-free by checking OPL pointer (fix #67) Fixes CVE-2018-17825. --- src/fmopl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fmopl.c b/src/fmopl.c index 0cd1d69..1c4485e 100644 --- a/src/fmopl.c +++ b/src/fmopl.c @@ -1269,6 +1269,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) /* ---------- Destroy one of vietual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { + if(!OPL) + { + return; + } #ifdef OPL_OUTPUT_LOG if(opl_dbg_fp) {