From 2080301088446a5d4c773e854e2ba8db3568b40f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 7 Sep 2016 00:57:05 +0200 Subject: [PATCH] matrix_4x4_multiply - add early return to prevent null pointer dereferences --- libretro-common/gfx/math/matrix_4x4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/gfx/math/matrix_4x4.c b/libretro-common/gfx/math/matrix_4x4.c index 091b3af2a7..e3c022cd0d 100644 --- a/libretro-common/gfx/math/matrix_4x4.c +++ b/libretro-common/gfx/math/matrix_4x4.c @@ -186,6 +186,9 @@ void matrix_4x4_multiply( unsigned r, c, k; math_matrix_4x4 mat; + if (!out || !a || !b) + return; + for (r = 0; r < 4; r++) { for (c = 0; c < 4; c++)