mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-27 20:10:26 +00:00
src/sndfile.c : Fix possible psf NULL dereference on SFC_GET_LIB_VERSION.
This commit is contained in:
parent
041e8ecd7d
commit
5a93e505ce
@ -816,14 +816,17 @@ sf_format_check (const SF_INFO *info)
|
||||
|
||||
int
|
||||
sf_command (SNDFILE *sndfile, int command, void *data, int datasize)
|
||||
{ SF_PRIVATE *psf = NULL ;
|
||||
{ SF_PRIVATE *psf = (SF_PRIVATE *) sndfile ;
|
||||
int old_value ;
|
||||
|
||||
/* This set of commands do not need the sndfile parameter. */
|
||||
switch (command)
|
||||
{ case SFC_GET_LIB_VERSION :
|
||||
if (data == NULL)
|
||||
return (psf->error = SFE_BAD_COMMAND_PARAM) ;
|
||||
{ if (psf)
|
||||
psf->error = SFE_BAD_COMMAND_PARAM ;
|
||||
return SFE_BAD_COMMAND_PARAM ;
|
||||
} ;
|
||||
if (ENABLE_EXPERIMENTAL_CODE)
|
||||
snprintf (data, datasize, "%s-%s-exp", PACKAGE_NAME, PACKAGE_VERSION) ;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user