summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2016-01-27 14:51:17 -0800
committerNanley Chery <nanley.g.chery@intel.com>2016-01-27 15:32:18 -0800
commit37ddeac9ae7ff5fd83fd3112566b651f12817e73 (patch)
tree751fe3eb2afd6af10b81f38bde7a43747fb9a7b3
parenta189ea567f9a647c79e4e35483e81a9ec42e0243 (diff)
Fix out of bounds array access
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
-rw-r--r--gen_mipmaps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gen_mipmaps.c b/gen_mipmaps.c
index d8c3b0d..b8edd9e 100644
--- a/gen_mipmaps.c
+++ b/gen_mipmaps.c
@@ -192,7 +192,7 @@ main(int argc, char *argv[])
puts("malloc failed");
int offset = 0;
int offset2 = 0;
- while (offset < lsize2) {
+ while (offset < *lsize) {
memcpy(ldata2 + offset2, *ldata+offset, 3);
ldata2[offset2+3] = 255;
offset+=3;