From: Michael Niedermayer Date: Thu, 11 Oct 2012 21:57:08 +0000 (+0200) Subject: rtspdec: Fix use of uninitialized byte X-Git-Tag: n1.1~1846^2~214 X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=eae35eadc0ae943598ed3f971245fe39a1cd213b;ds=sidebyside rtspdec: Fix use of uninitialized byte ffurl_read_complete can return 0 as well as negative error codes. Signed-off-by: Martin Storsjö --- diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 7476c45ba8..d46f1a4872 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -76,8 +76,8 @@ static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize, do { ret = ffurl_read_complete(rt->rtsp_hd, rbuf + idx, 1); - if (ret < 0) - return ret; + if (ret <= 0) + return ret ? ret : AVERROR_EOF; if (rbuf[idx] == '\r') { /* Ignore */ } else if (rbuf[idx] == '\n') {