Mercurial > mplayer.hg
changeset 18462:557d188e915a
raised max extradata size and refuse to store more than the limit
author | nicodvb |
---|---|
date | Fri, 12 May 2006 22:21:29 +0000 |
parents | e98125844f2d |
children | 11f8e670d7d3 |
files | libmpdemux/demux_ts.c |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_ts.c Fri May 12 21:34:06 2006 +0000 +++ b/libmpdemux/demux_ts.c Fri May 12 22:21:29 2006 +0000 @@ -114,10 +114,11 @@ 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 @@ 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;