From 74f789d083b35859fdcdcdd409015af7c164093e Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 31 Dec 2013 11:51:52 +0000 Subject: [PATCH] defs.c: in '2dcol' DEF token, clamp R, G, B values to [0 .. 63]. git-svn-id: https://svn.eduke32.com/eduke32@4232 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index 8ddb6a8cb..06ab79374 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -429,6 +429,10 @@ static int32_t defsparser(scriptfile *script) if ((unsigned)col < 256) { + r = clamp(r, 0, 63); + g = clamp(g, 0, 63); + b = clamp(b, 0, 63); + vgapal16[col*4+0] = b; // blue vgapal16[col*4+1] = g; // green vgapal16[col*4+2] = r; // red