소스 검색

img2txt: fix uninitialised data in BMP loader.

tags/v0.99.beta20
Sam Hocevar 6 년 전
부모
커밋
0b580d6630
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. +5
    -5
      src/common-image.c

+ 5
- 5
src/common-image.c 파일 보기

@@ -271,7 +271,7 @@ void unload_image(struct image * im)
#if !defined(USE_IMLIB2)
static unsigned int u32fread(caca_file_t * f)
{
uint8_t buffer[4];
uint8_t buffer[4] = { 0 };
caca_file_read(f, buffer, 4);
return ((unsigned int)buffer[3] << 24) | ((unsigned int)buffer[2] << 16)
| ((unsigned int)buffer[1] << 8) | ((unsigned int)buffer[0]);
@@ -279,16 +279,16 @@ static unsigned int u32fread(caca_file_t * f)

static unsigned int u16fread(caca_file_t * f)
{
uint8_t buffer[2];
uint8_t buffer[2] = { 0 };
caca_file_read(f, buffer, 2);
return ((unsigned int)buffer[1] << 8) | ((unsigned int)buffer[0]);
}

static unsigned int u8fread(caca_file_t * f)
{
uint8_t buffer;
caca_file_read(f, &buffer, 1);
return (unsigned int)buffer;
uint8_t buffer[1] = { 0 };
caca_file_read(f, buffer, 1);
return (unsigned int)buffer[0];
}
#endif


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