summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-12 22:21:29 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-12 22:21:29 +0000
commite631410ee706dd3feb3e0bdc12359525fe36feae (patch)
tree5c158d1c1c458450c80c2193a2c0035e51ab5ba4 /libmpdemux
parente32c4c57120a8f70e16a2a4e0ce03a320afb2bed (diff)
downloadmpv-e631410ee706dd3feb3e0bdc12359525fe36feae.tar.bz2
mpv-e631410ee706dd3feb3e0bdc12359525fe36feae.tar.xz
raised max extradata size and refuse to store more than the limit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18463 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_ts.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libmpdemux/demux_ts.c b/libmpdemux/demux_ts.c
index 1f9e0a0378..6e04ddbe61 100644
--- a/libmpdemux/demux_ts.c
+++ b/libmpdemux/demux_ts.c
@@ -114,10 +114,11 @@ typedef struct {
int offset, buffer_size;
} av_fifo_t;
+#define MAX_EXTRADATA_SIZE 64*1024
typedef struct {
int32_t object_type; //aka codec used
int32_t stream_type; //video, audio etc.
- uint8_t buf[4096];
+ uint8_t buf[MAX_EXTRADATA_SIZE];
uint16_t buf_size;
uint8_t szm1;
} mp4_decoder_config_t;
@@ -1859,6 +1860,11 @@ static uint16_t parse_mp4_decoder_specific_descriptor(pmt_t *pmt, uint8_t *buf,
mp_msg(MSGT_DEMUX, MSGL_DBG2, "%02x ", buf[i]);
mp_msg(MSGT_DEMUX, MSGL_DBG2, "\n");
+ if(len > MAX_EXTRADATA_SIZE)
+ {
+ mp_msg(MSGT_DEMUX, MSGL_ERR, "DEMUX_TS, EXTRADATA SUSPICIOUSLY BIG: %d, REFUSED\r\n", len);
+ return len;
+ }
memcpy(dec->buf, buf, len);
dec->buf_size = len;