[MPlayer-cvslog] r27746 - branches/1.0rc2/libmpdemux/demux_real.c
reimar
subversion at mplayerhq.hu
Sun Oct 12 17:28:57 CEST 2008
Author: reimar
Date: Sun Oct 12 17:28:57 2008
New Revision: 27746
Log:
Backport security fix: r27675 Apply patch for oCERT #2008-013 / CVE-2008-3827
Modified:
branches/1.0rc2/libmpdemux/demux_real.c
Modified: branches/1.0rc2/libmpdemux/demux_real.c
==============================================================================
--- branches/1.0rc2/libmpdemux/demux_real.c (original)
+++ branches/1.0rc2/libmpdemux/demux_real.c Sun Oct 12 17:28:57 2008
@@ -958,6 +958,7 @@ got_video:
// last fragment!
if(dp_hdr->len!=vpkg_length-vpkg_offset)
mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d frag.len=%d total.len=%d \n",dp->len,vpkg_offset,vpkg_length-vpkg_offset);
+ if (vpkg_offset > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) vpkg_offset = dp->len - sizeof(dp_hdr_t) - dp_hdr->len;
stream_read(demuxer->stream, dp_data+dp_hdr->len, vpkg_offset);
if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else
dp_hdr->len+=vpkg_offset;
@@ -981,6 +982,7 @@ got_video:
// non-last fragment:
if(dp_hdr->len!=vpkg_offset)
mp_msg(MSGT_DEMUX,MSGL_V,"warning! assembled.len=%d offset=%d frag.len=%d total.len=%d \n",dp->len,vpkg_offset,len,vpkg_length);
+ if (len > dp->len - sizeof(dp_hdr_t) - dp_hdr->len) len = dp->len - sizeof(dp_hdr_t) - dp_hdr->len;
stream_read(demuxer->stream, dp_data+dp_hdr->len, len);
if((dp_data[dp_hdr->len]&0x20) && (sh_video->format==0x30335652)) --dp_hdr->chunks; else
dp_hdr->len+=len;
@@ -1003,6 +1005,7 @@ got_video:
extra[0]=1; extra[1]=0; // offset of the first chunk
if(0x00==(vpkg_header&0xc0)){
// first fragment:
+ if (len > dp->len - sizeof(dp_hdr_t)) len = dp->len - sizeof(dp_hdr_t);
dp_hdr->len=len;
stream_read(demuxer->stream, dp_data, len);
ds->asf_packet=dp;
More information about the MPlayer-cvslog
mailing list