Avoid seeking on bad file descriptors

This commit is contained in:
Kleis Auke Wolthuizen 2020-12-22 11:19:09 +01:00
parent cc8f93a3ff
commit 2eeeedc957

View File

@ -153,7 +153,8 @@ vips_source_test_features( VipsSource *source )
* vips_source_seek() etc. or we might trigger seek emulation.
*/
if( source->data ||
class->seek( source, 0, SEEK_CUR ) != -1 ) {
(VIPS_CONNECTION( source )->descriptor != -1 &&
class->seek( source, 0, SEEK_CUR ) != -1) ) {
gint64 length;
VIPS_DEBUG_MSG( " seekable source\n" );