1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

http: fix potential NULL pointer issue

Found by clang analyzer. Untested.
This commit is contained in:
wm4 2012-11-01 00:22:12 +01:00
parent 02daf37328
commit 0212d7e804

View File

@ -195,7 +195,10 @@ static int scast_streaming_start(stream_t *stream) {
if (is_ultravox) if (is_ultravox)
metaint = 0; metaint = 0;
else { 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) if (metaint <= 0)
return -1; return -1;
} }