What does HRESULT 0x8004020E (VFW_E_BADALIGN) mean?

 
Could be also:
ConstantTypeOS
EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECTHRESULTWindows
Previous Next
EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT EVENT_E_INVALID_EVENT_CLASS_PARTITION

VFW_E_BADALIGN

Meaning

Windows documents VFW_E_BADALIGN as “An invalid alignment was specified”. In practical terms, it is returned when DirectShow allocator negotiation receives a buffer-alignment requirement that is invalid or cannot be honored.

Likely causes

  • Possible cause 1: cbAlign is zero or not supported by the allocator.
  • Possible cause 2: upstream and downstream filters require incompatible alignment.
  • Possible cause 3: a custom allocator reports properties different from those it actually provides.

Evidence to collect

  • Capture 1: requested and actual ALLOCATOR_PROPERTIES values.
  • Capture 2: the filter that proposed each alignment.
  • Capture 3: buffer addresses and SetProperties return data.

Correct handling and retry

  • Corrective action 1: supply a valid nonzero alignment supported by both pins.
  • Corrective action 2: honor the actual properties returned by the allocator.
  • Corrective action 3: correct custom allocator calculations for prefix, size and alignment together.

Retry guidance. Retry after renegotiating allocator properties while the allocator is decommitted and buffers are released.

Practical scenario

A hardware transform requires 16-byte buffers but a custom allocator advertises an impossible alignment value; correcting cbAlign resolves it.

Difference from nearby HRESULTs

VFW_E_SIZENOTSET concerns missing buffer size, while it concerns the alignment constraint on those buffers.

Official Microsoft references


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