INNER CODE UNIT · C
buf
1oom-fork/1oom · src/fmt_pic.c:238
buf = (uint8_t *)lib_stralloc(filename);
goto ready;
}
buf = lib_malloc(128);
if (0
|| ((fd = fopen(filename, "rb")) == 0)
|| ((len = fread(buf, 1, 128, fd)) < 32)
) {
log_error("loading '%s'\n", filename);
goto fail;
}
if (!fmt_pic_detect(buf, len)) {
log_error("unsupported picture format in '%s'\n", filename);
goto fail;
}
buf = lib_realloc(buf, BUFSIZE);
if ((l = fread(&buf[len], 1, BUFSIZE - 128, fd)) < 1) {
log_error("loading '%s'\n", filename);