diff options
author | 2001-08-31 19:19:15 +0000 | |
---|---|---|
committer | 2001-08-31 19:19:15 +0000 | |
commit | a0d8dad7c1a54fd175bbc249f45162d9428ad9a6 (patch) | |
tree | 3d964546547a9e1a35f8ac925082845e791fa849 /loader/dshow/DS_VideoDecoder.c | |
parent | 8f858e4ddbb4e02393465a1406c9610678c53edb (diff) |
Fix two memory accesses to unallocated memory (detected by electric fence)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1806 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader/dshow/DS_VideoDecoder.c')
-rw-r--r-- | loader/dshow/DS_VideoDecoder.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c index 54e3207324..60156166a3 100644 --- a/loader/dshow/DS_VideoDecoder.c +++ b/loader/dshow/DS_VideoDecoder.c @@ -63,7 +63,8 @@ DS_VideoDecoder::DS_VideoDecoder(const CodecInfo& info, const BITMAPINFOHEADER& m_sOurType.pbFormat = (char*)m_sVhdr; m_sVhdr2 = (VIDEOINFOHEADER*)(new char[sizeof(VIDEOINFOHEADER)+12]); - memcpy(m_sVhdr2, m_sVhdr, sizeof(VIDEOINFOHEADER)+12); + memcpy(m_sVhdr2, m_sVhdr, sizeof(VIDEOINFOHEADER)); + memset((char*)m_sVhdr2 + sizeof(VIDEOINFOHEADER), 0, 12); m_sVhdr2->bmiHeader.biCompression = 0; m_sVhdr2->bmiHeader.biBitCount = 24; @@ -79,7 +80,8 @@ DS_VideoDecoder::DS_VideoDecoder(const CodecInfo& info, const BITMAPINFOHEADER& m_sDestType.pUnk = 0; m_sDestType.cbFormat = sizeof(VIDEOINFOHEADER); m_sDestType.pbFormat = (char*)m_sVhdr2; - memcpy(&m_obh, m_bh, sizeof(m_obh)); + memset(&m_obh, 0, sizeof(m_obh)); + memcpy(&m_obh, m_bh, sizeof(m_obh) < m_bh->biSize ? sizeof(m_obh) : m_bh->biSize); m_obh.SetBits(24); HRESULT result; |