summaryrefslogtreecommitdiffstats
path: root/stream/http.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:54:52 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 17:55:05 +0300
commite913d6c5dabcf342d8c1a7070382d712fc354948 (patch)
tree965b5b698c7075e53123593eb4b5bfdb45d78c56 /stream/http.c
parentbe935e27666d8fdbf387adb1fcc30d243f6359dc (diff)
parent00959d5cf76d4ad94de9d0022b7b40a58acf2b95 (diff)
downloadmpv-e913d6c5dabcf342d8c1a7070382d712fc354948.tar.bz2
mpv-e913d6c5dabcf342d8c1a7070382d712fc354948.tar.xz
Merge svn changes up to r31004
Diffstat (limited to 'stream/http.c')
-rw-r--r--stream/http.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/stream/http.c b/stream/http.c
index c1018ff4d3..dda668e5f4 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -123,8 +123,13 @@ static void scast_meta_read(int fd, streaming_ctrl_t *sc) {
my_read(fd, &tmp, 1, sc);
metalen = tmp * 16;
if (metalen > 0) {
- char *info = malloc(metalen + 1);
+ int i;
+ uint8_t *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);