Package: libsndfile1-dev Version: 1.0.25-5 Severity: normal While reading the source code to debug some of the other bugs I reported, I noticed some invalid assumptions:
- psf_get_filelen_fd has: if (sizeof (statbuf.st_size) == 4 && sizeof (sf_count_t) == 8) return (sf_count_t) -SFE_BAD_STAT_SIZE ; There's no requirement for st_size to have a specific size. It may well be 32 bit (on older systems more likely). I also don't see the purpose of those checks: The code goes on to convert st_size to a sf_count_t. In the "error" case, this would convert a 32 bit value to a 64 bit one which is unproblematic. The problematic case (which may be what was actually meant here) would be (without requiring too specific sizes): if (sizeof (statbuf.st_size) > sizeof (sf_count_t)) return (sf_count_t) -SFE_BAD_STAT_SIZE ; - A file is considered seekable if psf_is_pipe returns false. psf_is_pipe (despite its name) checks for pipes and sockets. But there may be other non-seeakble files, e.g. char devices (unlikely but not impossible inputs). A more general and in fact easier way to determine if a file is not seekable is simply: return lseek(pdf->file.filedes, 0, SEEK_CUR) < 0; - Support for non-seekable inputs is questionable anyway: % head -c 10000 /dev/zero | oggenc -r - -o- | sndfile-convert -pcm16 /dev/stdin test.wav Not able to open input file /dev/stdin. Internal error : SF_INFO struct incomplete. % cat somefile.ogg | sndfile-convert -pcm16 /dev/stdin test.wav Not able to open input file /dev/stdin. Supported file format but file is malformed. strace shows (in both cases) that it tries to seek although it (correctly in this case) determined that pipes are not seekable. That's for Ogg/Vorbis, but grepping the code shows, for various formats, a number of calls of psf_fseek which are not from the respective seek methods, so would be called for non-seekable files. I see no easy fix except buffering the input internally. So perhaps it's best to declare that the library simply doesn't work with non-seekable inputs and remove the code that pretends it does, shifting the burden of buffering non-seekable inputs to the user of the library (which I will now do in my own code via sf_open_virtual). -- System Information: Debian Release: 7.6 APT prefers stable APT policy: (900, 'stable'), (500, 'stable-updates'), (500, 'proposed-updates') Architecture: i386 (i686) Kernel: Linux 3.2.0-4-686-pae (SMP w/6 CPU cores) Locale: LANG=de_DE, LC_CTYPE=de_DE (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/dash Versions of packages libsndfile1-dev depends on: ii libflac-dev 1.2.1-6 ii libsndfile1 1.0.25-5 ii libvorbis-dev 1.3.2-1.3 ii pkg-config 0.26-1 libsndfile1-dev recommends no packages. libsndfile1-dev suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org