Changeset 302


Ignore:
Timestamp:
Aug 1, 2014, 2:51:42 AM (8 years ago)
Author:
roman
Message:

Safer media type extra data extraction for bad/invalid media types

Location:
trunk/DirectShowSpy
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/DirectShowSpy/DirectShowSpy.rc

    r290 r302  
    6060
    6161VS_VERSION_INFO VERSIONINFO
    62  FILEVERSION  1, 0, 0, 1515
     62 FILEVERSION  1, 0, 0, 1519
    6363 PRODUCTVERSION 1,0,0,1
    6464 FILEFLAGSMASK 0x3fL
     
    7979            VALUE "CompanyName", "Roman Ryltsov"
    8080            VALUE "FileDescription", "Alax.Info DirectShow Spy Module"
    81             VALUE "FileVersion",  "1, 0, 0, 1515\0"
     81            VALUE "FileVersion",  "1, 0, 0, 1519\0"
    8282            VALUE "InternalName", "DirectShowSpy.dll"
    8383            VALUE "LegalCopyright", "Copyright © Alax.Info, Roman Ryltsov, 2008-2014"
  • trunk/DirectShowSpy/FilterGraphHelper.h

    r290 r302  
    26602660                {
    26612661                        if(!pnExtraData)
     2662                        {
     2663                                if(nExtraDataSize > pMediaType->cbFormat)
     2664                                        nExtraDataSize = pMediaType->cbFormat;
    26622665                                pnExtraData = pMediaType->pbFormat + pMediaType->cbFormat - nExtraDataSize;
     2666                        }
     2667                        const SSIZE_T nExtraDataExcessSize = (pnExtraData + nExtraDataSize) - (pMediaType->pbFormat + pMediaType->cbFormat);
     2668                        if(nExtraDataExcessSize > 0)
     2669                                nExtraDataSize -= min((SIZE_T) nExtraDataExcessSize, nExtraDataSize);
    26632670                        sText += AtlFormatString(_T("  * ") _T("Extra Data: %s") _T("\r\n"), I(AtlFormatData(pnExtraData, nExtraDataSize).TrimRight()));
    26642671                }
Note: See TracChangeset for help on using the changeset viewer.