splash/SplashScreen.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 1de363eecfa50f6432c5ff87c920213186815416 Author: Albert Astals Cid <[email protected]> Date: Tue Sep 6 00:09:40 2016 +0200 Fix another ubsan warning diff --git a/splash/SplashScreen.cc b/splash/SplashScreen.cc index 68ccd7d..9b0a267 100644 --- a/splash/SplashScreen.cc +++ b/splash/SplashScreen.cc @@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2009 Albert Astals Cid <[email protected]> +// Copyright (C) 2009, 2016 Albert Astals Cid <[email protected]> // Copyright (C) 2012 Fabio D'Urso <[email protected]> // // To see a description of the changes please see the Changelog file that @@ -30,6 +30,7 @@ #include <algorithm> #include "goo/gmem.h" #include "goo/grandom.h" +#include "goo/GooLikely.h" #include "SplashMath.h" #include "SplashScreen.h" @@ -377,7 +378,9 @@ SplashScreen::SplashScreen(SplashScreen *screen) { sizeM1 = screen->sizeM1; log2Size = screen->log2Size; mat = (Guchar *)gmallocn(size * size, sizeof(Guchar)); - memcpy(mat, screen->mat, size * size * sizeof(Guchar)); + if (likely(mat)) { + memcpy(mat, screen->mat, size * size * sizeof(Guchar)); + } minVal = screen->minVal; maxVal = screen->maxVal; } _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
