summaryrefslogtreecommitdiff
path: root/src/input/libreal/real.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-04-24 20:43:57 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2004-04-24 20:43:57 +0000
commitc93bfc952650b4299080bd0f23106a0d30e28bac (patch)
tree7fa54fc73a825c8066118093bd7a4ab6a7ed239b /src/input/libreal/real.c
parenta6946db794f2e51fbf7dfe24fe879dc683bc0eb2 (diff)
downloadxine-lib-c93bfc952650b4299080bd0f23106a0d30e28bac.tar.gz
xine-lib-c93bfc952650b4299080bd0f23106a0d30e28bac.tar.bz2
sanity cecking, safer buffer allocation
CVS patchset: 6432 CVS date: 2004/04/24 20:43:57
Diffstat (limited to 'src/input/libreal/real.c')
-rw-r--r--src/input/libreal/real.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index 2d05058a7..efc445645 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: real.c,v 1.17 2004/04/24 16:55:42 miguelfreitas Exp $
+ * $Id: real.c,v 1.18 2004/04/24 20:43:57 miguelfreitas Exp $
*
* special functions for real streams.
* adopted from joschkas real tools.
@@ -601,7 +601,7 @@ int real_get_rdt_chunk(rtsp_t *rtsp_session, unsigned char **buffer) {
size-=12;
n=rtsp_read_data(rtsp_session, (*buffer)+12, size);
- return n+12;
+ return (n <= 0) ? 0 : n+12;
}
rmff_header_t *real_setup_and_get_header(rtsp_t *rtsp_session, uint32_t bandwidth) {
@@ -661,7 +661,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) {
+ xine_buffer_free(buf);
+ return NULL;
+ }
description[size]=0;
/* parse sdp (sdpplin) and create a header and a subscribe string */