瀏覽代碼

REVIEWED: Possible overflow #4206

pull/4213/head
Ray 8 月之前
父節點
當前提交
923f983719
共有 2 個檔案被更改,包括 4 行新增2 行删除
  1. +2
    -1
      src/rlgl.h
  2. +2
    -1
      src/rtextures.c

+ 2
- 1
src/rlgl.h 查看文件

@ -4993,7 +4993,8 @@ static int rlGetPixelDataSize(int width, int height, int format)
default: break;
}
dataSize = width*height*bpp/8; // Total data size in bytes
char bytesPerPixel = bpp/8;
dataSize = width*height*bytesPerPixel; // Total data size in bytes
// Most compressed formats works on 4x4 blocks,
// if texture is smaller, minimum dataSize is 8 or 16

+ 2
- 1
src/rtextures.c 查看文件

@ -5403,7 +5403,8 @@ int GetPixelDataSize(int width, int height, int format)
default: break;
}
dataSize = width*height*bpp/8; // Total data size in bytes
char bytesPerPixel = bpp/8;
dataSize = width*height*bytesPerPixel; // Total data size in bytes
// Most compressed formats works on 4x4 blocks,
// if texture is smaller, minimum dataSize is 8 or 16

Loading…
取消
儲存