소스 검색

Redefine _caca_alloc2d in src/common-image.c

This is an internal function that can not be used in this sample code.
Easiest is to duplicate it.

Fixes https://github.com/cacalabs/libcaca/issues/67
main
Pascal Terjan 4 달 전
부모
커밋
00d5a26a13
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. +8
    -0
      src/common-image.c

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

@@ -29,6 +29,14 @@
static unsigned int u32fread(caca_file_t *); static unsigned int u32fread(caca_file_t *);
static unsigned int u16fread(caca_file_t *); static unsigned int u16fread(caca_file_t *);
static unsigned int u8fread(caca_file_t *); static unsigned int u8fread(caca_file_t *);

static void *_caca_alloc2d(size_t width, size_t height, size_t elem_size)
{
if (width == 0 || height == 0 || elem_size == 0 || SIZE_MAX / width / height < elem_size)
return NULL;
return malloc(width * height * elem_size);
}

#endif #endif


struct image * load_image(char const * name) struct image * load_image(char const * name)


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