decoder/flac: fixed NULL pointer dereference in CUE code

The function flac_vtrack_tnum() was missing a strrchr()==NULL check.
This commit is contained in:
Max Kellermann 2009-11-18 19:55:38 +01:00
parent f51ba6464a
commit 97f8e017c4
2 changed files with 3 additions and 0 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ ver 0.15.6 (2009/??/??)
- ffmpeg: align the output buffer
- oggflac: rewind stream after FLAC detection
- flac: fixed CUE seeking range check
- flac: fixed NULL pointer dereference in CUE code
* output_thread: check again if output is open on PAUSE
* update: delete ignored symlinks from database
* database: increased maximum line length to 32 kB

View File

@ -415,6 +415,8 @@ flac_vtrack_tnum(const char* fname)
* another/better way would be to use tag struct
*/
char* ptr = strrchr(fname, '_');
if (ptr == NULL)
return 0;
// copy ascii tracknumber to int
char vtrack[4];