瀏覽代碼

rtextures: Improve numerical stability of float multiplication (#2596)

Dimensions of Rectangle should be casted to int before multiplication,
otherwise there is a risk for underallocation/overallocation of memory.
pull/2604/head
Piotr Wierciński 2 年之前
committed by GitHub
父節點
當前提交
024a803665
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      src/rtextures.c

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

@ -875,7 +875,7 @@ Image ImageFromImage(Image image, Rectangle rec)
result.width = (int)rec.width;
result.height = (int)rec.height;
result.data = RL_CALLOC((int)p">(rec.width*n">rec.height)*bytesPerPixel, 1);
result.data = RL_CALLOC((int)rec.width*p">(int)rec.height*bytesPerPixel, 1);
result.format = image.format;
result.mipmaps = 1;

Loading…
取消
儲存