[vlc-commits] smf: fix division by zero

Rémi Denis-Courmont git at videolan.org
Sat Oct 29 11:33:08 CEST 2016


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Oct 28 17:59:38 2016 +0300| [90a19d81074e58f56935658443fb356be6ab9753] | committer: Rémi Denis-Courmont

smf: fix division by zero

(cherry picked from commit edc9d41049db000d9a3d4c6453037b6e0b3cab1d)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=90a19d81074e58f56935658443fb356be6ab9753
---

 modules/demux/smf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/demux/smf.c b/modules/demux/smf.c
index 952cf04..32ca805 100644
--- a/modules/demux/smf.c
+++ b/modules/demux/smf.c
@@ -613,6 +613,11 @@ static int Open (vlc_object_t *obj)
     }
     else
     {
+        if (ppqn == 0)
+        {
+            msg_Err(demux, "invalid SMF file PPQN: %u", ppqn);
+            return VLC_EGENERIC;
+        }
         msg_Dbg (demux, " %u pulses per quarter note", ppqn);
     }
 



More information about the vlc-commits mailing list