changeset 2219:fa6c59a5ab0d libavformat

check udp_read_packet return value not to access uninitialized memory patch by Eric Paul: [eric paul gmail com] original thread: [FFmpeg-devel] [PATCH] : libavformat segfault when a RTSP reading is interrupted date: 07/05/2007 03:13 PM
author benoit
date Thu, 05 Jul 2007 20:58:34 +0000
parents a477001ad010
children 0d93ef692caa
files rtsp.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rtsp.c	Thu Jul 05 20:08:51 2007 +0000
+++ b/rtsp.c	Thu Jul 05 20:58:34 2007 +0000
@@ -1194,7 +1194,7 @@
     case RTSP_PROTOCOL_RTP_UDP:
     case RTSP_PROTOCOL_RTP_UDP_MULTICAST:
         len = udp_read_packet(s, &rtsp_st, buf, sizeof(buf));
-        if (rtsp_st->rtp_ctx)
+        if (len >=0 && rtsp_st->rtp_ctx)
             rtp_check_and_send_back_rr(rtsp_st->rtp_ctx, len);
         break;
     }