1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-22 12:46:19 +00:00
Lakka-LibreELEC/packages/addons/addon-depends/tslib/patches/tslib-20-fbutils_fix_x64_execution.patch

25 lines
876 B
Diff

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;