File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ ExternalProject_Add(sox
197197 URL https://downloads.sourceforge.net/project/sox/sox/14.4.2/sox-14.4.2.tar.bz2
198198 URL_HASH SHA256=81a6956d4330e75b5827316e44ae381e6f1e8928003c6aa45896da9041ea149c
199199 CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env ${envs} ${CMAKE_CURRENT_BINARY_DIR} /src/sox/configure ${COMMON_ARGS} ${SOX_OPTIONS}
200+ PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR} /patch/sox.patch
200201 BUILD_BYPRODUCTS ${SOX_LIBRARIES}
201202 DOWNLOAD_NO_PROGRESS ON
202203 LOG_DOWNLOAD ON
Original file line number Diff line number Diff line change 1+ See https://github.com/pytorch/audio/pull/1297
2+ diff -ru sox/src/formats.c sox/src/formats.c
3+ --- sox/src/formats.c 2014-10-26 19:55:50.000000000 -0700
4+ +++ sox/src/formats.c 2021-02-22 16:01:02.833144070 -0800
5+ @@ -333,6 +333,10 @@
6+ assert(ft);
7+ if (!ft->fp)
8+ return sox_false;
9+ - fstat(fileno((FILE*)ft->fp), &st);
10+ + int fd = fileno((FILE*)ft->fp);
11+ + if (fd < 0)
12+ + return sox_false;
13+ + if (fstat(fd, &st) < 0)
14+ + return sox_false;
15+ return ((st.st_mode & S_IFMT) == S_IFREG);
16+ }
You can’t perform that action at this time.
0 commit comments