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
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}