mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
src/aiff.c : Fix potential memory leak in handling of 'MARK' chunk.
This commit is contained in:
parent
af03cbfac4
commit
c924272b52
@ -18,6 +18,12 @@
|
||||
* tests/win32_test.c
|
||||
Add missing close on file descriptor.
|
||||
|
||||
* src/nist.c programs/sndfile-metadata-set.c
|
||||
Fix 'unused variable' warnings.
|
||||
|
||||
* src/aiff.c
|
||||
Fix potential memory leak in handling of 'MARK' chunk.
|
||||
|
||||
2009-02-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/sd2.c
|
||||
|
@ -763,8 +763,14 @@ aiff_read_header (SF_PRIVATE *psf, COMM_CHUNK *comm_fmt)
|
||||
|
||||
bytesread = psf_binheader_readf (psf, "E2", &n) ;
|
||||
mark_count = n ;
|
||||
markstr = calloc (mark_count, sizeof (MARK_ID_POS)) ;
|
||||
psf_log_printf (psf, " Count : %d\n", mark_count) ;
|
||||
if (markstr != NULL)
|
||||
{ psf_log_printf (psf, "*** Second MARK chunk found. Throwing away the first.\n") ;
|
||||
free (markstr) ;
|
||||
} ;
|
||||
markstr = calloc (mark_count, sizeof (MARK_ID_POS)) ;
|
||||
if (markstr == NULL)
|
||||
return SFE_MALLOC_FAILED ;
|
||||
|
||||
for (n = 0 ; n < mark_count && bytesread < dword ; n++)
|
||||
{ bytesread += psf_binheader_readf (psf, "E241", &mark_id, &position, &pstr_len) ;
|
||||
|
Loading…
Reference in New Issue
Block a user