diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-31 19:42:15 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-31 19:42:15 +0000 |
commit | 006c481c1ebad613780ff243c1d4908181d0f425 (patch) | |
tree | cf39b0f48b36d0c5c6cfcd91ff349f2b8a92a25f | |
parent | c800858e60e7155fa3484aed855bd3586d7b63d4 (diff) |
Sanitize ICY metadata a bit before printing it.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30980 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | stream/http.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stream/http.c b/stream/http.c index d79f7632ca..d6f5086fda 100644 --- a/stream/http.c +++ b/stream/http.c @@ -124,8 +124,13 @@ static void scast_meta_read(int fd, streaming_ctrl_t *sc) { my_read(fd, &tmp, 1, sc); metalen = tmp * 16; if (metalen > 0) { + int i; char *info = malloc(metalen + 1); unsigned nlen = my_read(fd, info, metalen, sc); + // avoid breaking the user's terminal too much + if (nlen > 256) nlen = 256; + for (i = 0; i < nlen; i++) + if (info[i] && info[i] < 32) info[i] = '?'; info[nlen] = 0; mp_msg(MSGT_DEMUXER, MSGL_INFO, "\nICY Info: %s\n", info); free(info); |