What does HRESULT 0x80040248 (VFW_E_INVALID_MEDIA_TYPE) mean?

 
Previous Next
VFW_E_INVALID_CLSID VFW_E_SAMPLE_TIME_NOT_SET

VFW_E_INVALID_MEDIA_TYPE

Meaning

Windows documents VFW_E_INVALID_MEDIA_TYPE as “This file is corrupt: it contains an invalid media type”. Here, DirectShow reconstructs a graph or connection from persisted data and finds a media-type record that is structurally invalid.

Conditions that can produce it

  • Cause 1: the format block length does not match the serialized payload.
  • Cause 2: major type, subtype and format type are inconsistent.
  • Cause 3: pointer-sized or alignment-dependent data was persisted incorrectly.

Relevant contract

Start with the filter graph, device or persisted configuration that first returned the result.

Evidence worth preserving

  • Evidence 1: AM_MEDIA_TYPE fields and format-block length.
  • Evidence 2: pin pair and connection being restored.
  • Evidence 3: file offset, writer architecture and serializer version.

Correction strategy

  • Action 1: regenerate the media type from a live pin negotiation.
  • Action 2: validate cbFormat and format structure before use.
  • Action 3: serialize portable values rather than raw in-process pointers.

Example incident

A 32-bit application persists an AM_MEDIA_TYPE blob that a 64-bit loader interprets as raw structure memory; portable field serialization prevents it.

Retry and recovery

Retry rule: Retry after correcting the media-type record or allowing fresh negotiation instead of replaying the corrupt record.

How it differs from nearby results

VFW_E_INVALID_FILE_FORMAT describes an invalid container, while it identifies a malformed DirectShow media-type description within a graph or connection.

Official Microsoft references


Looking for a different code? Search another status or error code.