# -*- Mode: Diff -*- --- src/hb-blob.cc +++ src/hb-blob.cc @@ -737,7 +737,19 @@ char *data = (char *) hb_malloc (allocated); if (unlikely (!data)) return nullptr; - FILE *fp = fopen (file_name, "rb"); + FILE *fp; + int nFD; + int n; + if (sscanf (file_name, "/:FD:/%d%n", &nFD, &n) == 1 && file_name[n] == '\0') + { + lseek (nFD, 0, SEEK_SET); + fp = fdopen (dup (nFD), "rb"); + } + else + { + fp = fopen (file_name, "rb"); + } + if (unlikely (!fp)) goto fread_fail_without_close; while (!feof (fp))