mcst-linux-kernel/patches-2024.06.26/gl4es-1.1.4/0055-Added-one-more-check-o...

29 lines
966 B
Diff

From 9f21c791274bfb18404d1fd424fb162e1445c35a Mon Sep 17 00:00:00 2001
From: ptitSeb <sebastien.chev@gmail.com>
Date: Sun, 18 Oct 2020 10:42:17 +0200
Subject: [PATCH 055/233] Added one more check on pixel_convert for identicall
format conversion
---
src/gl/pixel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gl/pixel.c b/src/gl/pixel.c
index 69792f3c..901d6134 100755
--- a/src/gl/pixel.c
+++ b/src/gl/pixel.c
@@ -773,6 +773,10 @@ bool pixel_convert(const GLvoid *src, GLvoid **dst,
if ((src_type == dst_type) && (dst_format == src_format)) {
if (*dst == src)
return true;
+ if (!dst_size || !pixel_sizeof(src_format, src_type)) {
+ LOGE("pixel conversion, unknow format size, anticipated abort\n");
+ return false;
+ }
if (*dst == NULL) // alloc dst only if dst==NULL
*dst = malloc(dst_size);
if (stride) // for in-place conversion
--
2.11.0