Skip to content

Commit 9d470ee

Browse files
committed
src/rf64.c: Fix varargs related bug
C's <stargs.h> functionality isn't type checked so that passing an `sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause errors. This would be fine if it was an error on every architecture and platform, but its not. This particular problem only manifested on armhf and some other Arm architectures. It was not an issue on 32 bit x86. I have now fixed variants of this same bug several times. Closes: libsndfile#229
1 parent bf83b95 commit 9d470ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rf64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)
742742

743743
pad_size = psf->dataoffset - 16 - psf->header.indx ;
744744
if (pad_size >= 0)
745-
psf_binheader_writef (psf, "m4z", PAD_MARKER, pad_size, make_size_t (pad_size)) ;
745+
psf_binheader_writef (psf, "m4z", PAD_MARKER, (unsigned int) pad_size, make_size_t (pad_size)) ;
746746

747747
if (wpriv->rf64_downgrade && (psf->filelength < RIFF_DOWNGRADE_BYTES))
748748
psf_binheader_writef (psf, "tm8", data_MARKER, psf->datalength) ;

0 commit comments

Comments
 (0)