소스 검색

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
No known key found for this signature in database GPG 키 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;

불러오는 중...
취소
저장