aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-18 19:55:38 +0100
committerMax Kellermann <max@duempel.org>2009-11-18 19:55:38 +0100
commit97f8e017c4c141a01b5d0213590f1a923b6a359d (patch)
tree3cf84cb0c35d91eb259f6f92cfc2a90a46c2752a
parentf51ba6464adf1d2324c418e106b66da525f01587 (diff)
downloadmpd-97f8e017c4c141a01b5d0213590f1a923b6a359d.tar.gz
mpd-97f8e017c4c141a01b5d0213590f1a923b6a359d.tar.xz
mpd-97f8e017c4c141a01b5d0213590f1a923b6a359d.zip
decoder/flac: fixed NULL pointer dereference in CUE code
The function flac_vtrack_tnum() was missing a strrchr()==NULL check.
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/decoder/_flac_common.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 8bd2369d2..3c4c2e0d8 100644
--- a/NEWS
+++ b/NEWS
@@ -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
diff --git a/src/decoder/_flac_common.c b/src/decoder/_flac_common.c
index e096750f3..9338dc6ae 100644
--- a/src/decoder/_flac_common.c
+++ b/src/decoder/_flac_common.c
@@ -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];