src/strings.c : Fix logic for testing if audio data has been written and string is added.

This commit is contained in:
Erik de Castro Lopo 2007-07-13 21:21:46 +10:00
parent 01527eace7
commit 3211a29d2f
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,9 @@
* tests/string_test.c
Add ability to test strings stored in metadata secion of FLAC files.
* src/string.c
Fix logic for testing if audio data has been written and string is added.
2007-07-12 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/flac.c

View File

@ -45,7 +45,7 @@ psf_store_string (SF_PRIVATE *psf, int str_type, const char *str)
if (psf->mode == SFM_WRITE || psf->mode == SFM_RDWR)
{ if ((psf->str_flags & SF_STR_ALLOW_START) == 0)
return SFE_STR_NO_SUPPORT ;
if ((psf->str_flags & SF_STR_ALLOW_END) == 0)
if (psf->have_written && (psf->str_flags & SF_STR_ALLOW_END) == 0)
return SFE_STR_NO_SUPPORT ;
/* Only allow zero length strings for software. */
if (str_type != SF_STR_SOFTWARE && str_len == 0)