summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-01 00:22:12 +0100
committerwm4 <wm4@nowhere>2012-11-01 02:12:17 +0100
commit0212d7e804da82784bb2c60c08fc86e8aa160874 (patch)
tree1802df4441812fe4be12a5efc54a9eeeba6035e0 /stream
parent02daf37328c57ab12bd086a0d4ce91a5f6d70a97 (diff)
downloadmpv-0212d7e804da82784bb2c60c08fc86e8aa160874.tar.bz2
mpv-0212d7e804da82784bb2c60c08fc86e8aa160874.tar.xz
http: fix potential NULL pointer issue
Found by clang analyzer. Untested.
Diffstat (limited to 'stream')
-rw-r--r--stream/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/http.c b/stream/http.c
index 3971aa9d05..61795bcf9b 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -195,7 +195,10 @@ static int scast_streaming_start(stream_t *stream) {
if (is_ultravox)
metaint = 0;
else {
- metaint = atoi(http_get_field(http_hdr, "Icy-MetaInt"));
+ metaint = -1;
+ char *h = http_get_field(http_hdr, "Icy-MetaInt");
+ if (h)
+ metaint = atoi(h);
if (metaint <= 0)
return -1;
}