mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
src/broadcast.c : Fix checking of required coding_history_size.
This commit is contained in:
parent
b1222dc88e
commit
2c1771259f
@ -7,6 +7,9 @@
|
||||
* programs/test-sndfile-metadata-set.py
|
||||
Add test for the above.
|
||||
|
||||
* src/broadcast.c
|
||||
Fix checking of required coding_history_size.
|
||||
|
||||
2008-10-28 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* tests/command_test.c
|
||||
|
@ -66,10 +66,13 @@ broadcast_var_set (SF_PRIVATE *psf, const SF_BROADCAST_INFO * info, size_t datas
|
||||
|
||||
added_history_len = gen_coding_history (added_history, sizeof (added_history), &(psf->sf)) ;
|
||||
|
||||
if (psf->broadcast_var != NULL
|
||||
&& psf->broadcast_var->binfo.coding_history_size + added_history_len < datasize)
|
||||
{ free (psf->broadcast_var) ;
|
||||
psf->broadcast_var = NULL ;
|
||||
if (psf->broadcast_var != NULL)
|
||||
{ size_t coding_hist_offset = offsetof (SF_BROADCAST_INFO, coding_history) ;
|
||||
|
||||
if (psf->broadcast_var->binfo.coding_history_size + added_history_len < datasize - coding_hist_offset)
|
||||
{ free (psf->broadcast_var) ;
|
||||
psf->broadcast_var = NULL ;
|
||||
} ;
|
||||
} ;
|
||||
|
||||
if (psf->broadcast_var == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user