summaryrefslogtreecommitdiffstats
path: root/libmpdemux/realrtsp/real.c
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-25 00:17:23 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-04-25 00:17:23 +0000
commitd547053b43a31357d1c37215e6f10372b29d3439 (patch)
tree5b32e8852553571d41e0ac500764285bb2848a36 /libmpdemux/realrtsp/real.c
parent4f80127142d56f57f8ec9c50e73d2ad57adf3e85 (diff)
downloadmpv-d547053b43a31357d1c37215e6f10372b29d3439.tar.bz2
mpv-d547053b43a31357d1c37215e6f10372b29d3439.tar.xz
More bounds checking fixes (thnaks to Miguel Freitas)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12272 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/realrtsp/real.c')
-rw-r--r--libmpdemux/realrtsp/real.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libmpdemux/realrtsp/real.c b/libmpdemux/realrtsp/real.c
index b175514479..0e88f7442b 100644
--- a/libmpdemux/realrtsp/real.c
+++ b/libmpdemux/realrtsp/real.c
@@ -661,7 +661,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, char **buffer) {
size-=12;
n=rtsp_read_data(rtsp_session, (*buffer)+12, size);
- return n+12;
+ return (n <= 0) ? 0 : n+12;
}
int convert_timestamp(char *str, int *sec, int *msec) {
@@ -744,7 +744,10 @@ rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwid
description=malloc(sizeof(char)*(size+1));
- rtsp_read_data(rtsp_session, description, size);
+ if( rtsp_read_data(rtsp_session, description, size) <= 0) {
+ buf = xbuffer_free(buf);
+ return NULL;
+ }
description[size]=0;
/* parse sdp (sdpplin) and create a header and a subscribe string */