CheckVideoInfoType function

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The CheckVideoInfoType function checks a media type that contains a VIDEOINFOHEADER format structure for certain common errors that can cause buffer overruns or integer overflows.

Note

This function does not guarantee that the media type is valid or that code using the structure is secure.

Syntax

HRESULT CheckVideoInfoType(
   const AM_MEDIA_TYPE *pmt
);

Parameters

pmt

Pointer to the AM_MEDIA_TYPE structure to validate

Return value

Returns one of the following HRESULT values.

Return code Description
S_OK
Success.
E_POINTER
NULL pointer value.
VFW_E_TYPE_NOT_ACCEPTED
Invalid media type.

Remarks

This function calls ValidateBitmapInfoHeader to validate the BITMAPINFOHEADER structure in the media type. If the format type is not FORMAT_VideoInfo, the function returns VFW_E_TYPE_NOT_ACCEPTED.

Requirements

Requirement Value
Header
Checkbmi.h

See also

Video and Image Functions