mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-30 05:20:59 +00:00
Make sure length of header buffer can hold header plus strings.
This commit is contained in:
parent
32f0eb11d3
commit
7ec8e15eb3
@ -58,6 +58,7 @@
|
||||
#define SF_TEXT_LEN (1024)
|
||||
#define SF_SYSERR_LEN (256)
|
||||
#define SF_MAX_STRINGS (16)
|
||||
#define SF_STR_BUFFER_LEN (4096)
|
||||
|
||||
#define PSF_SEEK_ERROR ((sf_count_t) -1)
|
||||
|
||||
@ -217,7 +218,7 @@ typedef struct sf_private_tag
|
||||
** sound files.
|
||||
*/
|
||||
STR_DATA strings [SF_MAX_STRINGS] ;
|
||||
char str_storage [SF_BUFFER_LEN] ;
|
||||
char str_storage [SF_STR_BUFFER_LEN] ;
|
||||
char *str_end ;
|
||||
int str_flags ;
|
||||
|
||||
|
@ -85,9 +85,9 @@ psf_store_string (SF_PRIVATE *psf, int str_type, const char *str)
|
||||
|
||||
|
||||
#if STRINGS_DEBUG
|
||||
psf_log_printf (psf, "str_storage : %X\n", (int) psf->str_storage) ;
|
||||
psf_log_printf (psf, "str_end : %X\n", (int) psf->str_end) ;
|
||||
psf_log_printf (psf, "sizeof (storage) : %d\n", SIGNED_SIZEOF (psf->str_storage)) ;
|
||||
psf_log_printf (psf, "str_storage : %X\n", (int) psf->str_storage) ;
|
||||
psf_log_printf (psf, "str_end : %X\n", (int) psf->str_end) ;
|
||||
psf_log_printf (psf, "sizeof (str_storage) : %d\n", SIGNED_SIZEOF (psf->str_storage)) ;
|
||||
#endif
|
||||
|
||||
len_remaining = SIGNED_SIZEOF (psf->str_storage) - (psf->str_end - psf->str_storage) ;
|
||||
|
Loading…
Reference in New Issue
Block a user