touchscreen: fix a crash with segfaults on x64 machines

This commit is contained in:
Peter Vicman 2019-06-27 11:54:38 +02:00
parent 60e06a17a3
commit 6f8b63acfe
3 changed files with 30 additions and 2 deletions

View File

@ -0,0 +1,24 @@
From c4c59790f3191c1a233fc1a61f8fedad85de1aeb Mon Sep 17 00:00:00 2001
From: Peter Fink <pfink@christ-es.de>
Date: Wed, 8 Feb 2017 14:04:45 +0100
Subject: [PATCH] fbutils: Fix x64 execution. Call malloc not with a hardcoded
sizeof(__u32). This caused the application to crash with segfaults on x64
machines.
---
tests/fbutils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/fbutils.c b/tests/fbutils.c
index 8ee494bc..fd7fbfe9 100644
--- a/tests/fbutils.c
+++ b/tests/fbutils.c
@@ -138,7 +138,7 @@ int open_framebuffer(void)
memset(fbuffer,0,fix.smem_len);
bytes_per_pixel = (var.bits_per_pixel + 7) / 8;
- line_addr = malloc (sizeof (__u32) * var.yres_virtual);
+ line_addr = malloc (sizeof (line_addr) * var.yres_virtual);
addr = 0;
for (y = 0; y < var.yres_virtual; y++, addr += fix.line_length)
line_addr [y] = fbuffer + addr;

View File

@ -1,2 +1,6 @@
+100
102
- Fix a crash with segfaults on x64 machines
101
- Update
100
- Initial release

View File

@ -3,7 +3,7 @@
PKG_NAME="touchscreen"
PKG_VERSION="1.0"
PKG_REV="101"
PKG_REV="102"
PKG_ARCH="any"
PKG_ADDON_PROJECTS="Generic RPi"
PKG_LICENSE="GPL"