From 795c079c5545078c3f1a8483abbb8b207ed8e534 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 23 May 2020 18:04:58 +0200 Subject: [PATCH] Corrected issues on LoadPKM() --- src/textures.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/textures.c b/src/textures.c index 378a9a13..d12ec038 100644 --- a/src/textures.c +++ b/src/textures.c @@ -3522,7 +3522,7 @@ static Image LoadPKM(const char *fileName) int dataSize = image.width*image.height*bpp/8; // Total data size in bytes - image.data = (unsigned char *)RL_MALLOC(size*sizeof(unsigned char)); + image.data = (unsigned char *)RL_MALLOC(dataSize*sizeof(unsigned char)); memcpy(image.data, fileDataPtr, dataSize); @@ -3831,7 +3831,7 @@ static Image LoadPVR(const char *fileName) else if (pvrHeader->channels[0] == 2) image.format = COMPRESSED_PVRT_RGB; else if (pvrHeader->channels[0] == 3) image.format = COMPRESSED_PVRT_RGBA; - fileDataPtr += pvrHeader->metaDataSize); // Skip meta data header + fileDataPtr += pvrHeader->metaDataSize; // Skip meta data header // Calculate data size (depends on format) int bpp = 0;