Skip to content

Commit

Permalink
src/rf64.c: Fix varargs related bug
Browse files Browse the repository at this point in the history
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: #229
  • Loading branch information
erikd committed Apr 16, 2017
1 parent bf83b95 commit 9d470ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rf64.c
Expand Up @@ -742,7 +742,7 @@ rf64_write_header (SF_PRIVATE *psf, int calc_length)

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

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

0 comments on commit 9d470ee

Please sign in to comment.