Skip to content
Browse files

src/sndfile.c : Return error when SF_BROADCAST_INFO struct has bad co…

…ding_history_size.
  • Loading branch information...
1 parent f219c65 commit cc34f5c3bff375827c839abb8ebf4de771227e08 @erikd committed Feb 21, 2012
Showing with 9 additions and 16 deletions.
  1. +6 −0 ChangeLog
  2. +3 −16 src/sndfile.c
View
6 ChangeLog
@@ -1,3 +1,9 @@
+2012-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
+
+ * src/sndfile.c
+ Return error when SF_BROADCAST_INFO struct has bad coding_history_size.
+ Thanks to Alex Weiss for the report.
+
2012-02-20 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/au.c src/flac.c src/g72x.c src/ogg_vorbis.c src/wav_w64.c
View
19 src/sndfile.c
@@ -91,7 +91,7 @@ ErrorStruct SndfileErrors [] =
{ SFE_NO_PIPE_WRITE , "Error : this file format does not support pipe write." },
{ SFE_BAD_VIRTUAL_IO , "Error : bad pointer on SF_VIRTUAL_IO struct." },
{ SFE_BAD_BROADCAST_INFO_SIZE
- , "Error : bad size in SF_BROADCAST_INFO struct." },
+ , "Error : bad coding_history_size in SF_BROADCAST_INFO struct." },
{ SFE_BAD_BROADCAST_INFO_TOO_BIG
, "Error : SF_BROADCAST_INFO struct too large." },
@@ -1170,15 +1170,8 @@ sf_command (SNDFILE *sndfile, int command, void *data, int datasize)
return SF_FALSE ;
} ;
-#if 0
- if (psf->broadcast_info == NULL)
- psf->broadcast_info = broadcast_info_alloc () ;
-
- broadcast_info_copy (psf->broadcast_info, data) ;
- broadcast_add_coding_history (psf->broadcast_info, psf->sf.channels, psf->sf.samplerate, psf->sf.format) ;
-#else
- broadcast_var_set (psf, data, datasize) ;
-#endif
+ if (NOT (broadcast_var_set (psf, data, datasize)))
+ return SF_FALSE ;
if (psf->write_header)
psf->write_header (psf, SF_TRUE) ;
@@ -1189,13 +1182,7 @@ sf_command (SNDFILE *sndfile, int command, void *data, int datasize)
{ psf->error = SFE_BAD_COMMAND_PARAM ;
return SF_FALSE ;
} ;
-#if 0
- if (psf->broadcast_info == NULL)
- return SF_FALSE ;
- return broadcast_info_copy (data, psf->broadcast_info) ;
-#else
return broadcast_var_get (psf, data, datasize) ;
-#endif
case SFC_GET_INSTRUMENT :
if (datasize != sizeof (SF_INSTRUMENT) || data == NULL)

0 comments on commit cc34f5c

Please sign in to comment.
Something went wrong with that request. Please try again.