You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
493 B
17 lines
493 B
2 years ago
|
See https://github.com/pytorch/audio/pull/1297
|
||
|
diff -ru sox/src/formats.c sox/src/formats.c
|
||
|
--- sox/src/formats.c 2014-10-26 19:55:50.000000000 -0700
|
||
|
+++ sox/src/formats.c 2021-02-22 16:01:02.833144070 -0800
|
||
|
@@ -333,6 +333,10 @@
|
||
|
assert(ft);
|
||
|
if (!ft->fp)
|
||
|
return sox_false;
|
||
|
- fstat(fileno((FILE*)ft->fp), &st);
|
||
|
+ int fd = fileno((FILE*)ft->fp);
|
||
|
+ if (fd < 0)
|
||
|
+ return sox_false;
|
||
|
+ if (fstat(fd, &st) < 0)
|
||
|
+ return sox_false;
|
||
|
return ((st.st_mode & S_IFMT) == S_IFREG);
|
||
|
}
|