diff mbox series

[FFmpeg-devel,6/6] avformat/rtspdec: return proper error code

Message ID 1604497047-30429-6-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 89429cf2f260340c26d262b0da691e988e572e44
Headers show
Series [FFmpeg-devel,1/6] avformat/rtsp: 16384 -> SDP_MAX_SIZE | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Limin Wang Nov. 4, 2020, 1:37 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/rtspdec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 3abf34b..a4cd1f6 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -768,7 +768,7 @@  redo:
     }
     ret = ffurl_read_complete(rt->rtsp_hd, buf, 3);
     if (ret != 3)
-        return -1;
+        return AVERROR(EIO);
     id  = buf[0];
     len = AV_RB16(buf + 1);
     av_log(s, AV_LOG_TRACE, "id=%d len=%d\n", id, len);
@@ -777,10 +777,10 @@  redo:
     /* get the data */
     ret = ffurl_read_complete(rt->rtsp_hd, buf, len);
     if (ret != len)
-        return -1;
+        return AVERROR(EIO);
     if (rt->transport == RTSP_TRANSPORT_RDT &&
-        ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL) < 0)
-        return -1;
+        (ret = ff_rdt_parse_header(buf, len, &id, NULL, NULL, NULL, NULL)) < 0)
+        return ret;
 
     /* find the matching stream */
     for (i = 0; i < rt->nb_rtsp_streams; i++) {