summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Stembridge <jstembridge@users.sourceforge.net>2003-07-18 23:34:36 +0000
committerJames Stembridge <jstembridge@users.sourceforge.net>2003-07-18 23:34:36 +0000
commit3eb65c758be362b8a69c78a671888680358ddbd6 (patch)
tree97f128416c0e09af6211b9a7a1f6656c82c36df8
parentb122347a35550a13880d405bd5f1592ae914b9a7 (diff)
downloadxine-lib-3eb65c758be362b8a69c78a671888680358ddbd6.tar.gz
xine-lib-3eb65c758be362b8a69c78a671888680358ddbd6.tar.bz2
increase maximum number of video streams
add checks to prevent segfaults when max number of streams is exceeded CVS patchset: 5176 CVS date: 2003/07/18 23:34:36
-rw-r--r--src/demuxers/demux_real.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 9c7c7e16a..cdaab8e78 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -30,7 +30,7 @@
*
* Based on FFmpeg's libav/rm.c.
*
- * $Id: demux_real.c,v 1.60 2003/07/16 14:14:17 andruil Exp $
+ * $Id: demux_real.c,v 1.61 2003/07/18 23:34:36 jstembridge Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -79,7 +79,7 @@
#define PN_KEYFRAME_FLAG 0x0002
-#define MAX_VIDEO_STREAMS 8
+#define MAX_VIDEO_STREAMS 10
#define MAX_AUDIO_STREAMS 8
typedef struct {
@@ -412,6 +412,12 @@ static void real_parse_headers (demux_real_t *this) {
if(BE_32(mdpr->type_specific_data) == RA_TAG) {
int version;
+ if(this->num_audio_streams == MAX_AUDIO_STREAMS) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "maximum number of audio stream exceeded\n");
+ goto unknown;
+ }
+
version = BE_16(mdpr->type_specific_data + 4);
lprintf("audio version %d detected\n", version);
@@ -440,6 +446,12 @@ static void real_parse_headers (demux_real_t *this) {
} else if(BE_32(mdpr->type_specific_data + 4) == VIDO_TAG) {
+ if(this->num_video_streams == MAX_VIDEO_STREAMS) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "maximum number of video stream exceeded\n");
+ goto unknown;
+ }
+
lprintf ("video detected\n");
fourcc = *(uint32_t *) (mdpr->type_specific_data + 8);
lprintf("fourcc = %.4s\n", (char *) &fourcc);