aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
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 /src/decoder
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--src/decoder/_flac_common.c2
1 files changed, 2 insertions, 0 deletions
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];