Skip to content

[Bug]: EAccessViolation Write 0x440 in amfrtdrv64.dll on CreateSurfaceFromHostNative (HOST RAM fallback) - Ryzen 7 5700G (Cezanne APU) #594

@miguelandradedotcom

Description

@miguelandradedotcom

Describe the bug
When using the AMF AVC encoder via direct API (not FFmpeg), the HOST RAM fallback
pipeline crashes with an Access Violation inside amfrtdrv64.dll.

The crash occurs consistently after CreateSurfaceFromDX11Native fails (HR=0x00000011)
and the encoder falls back to HOST RAM mode. After ResetContextForHost creates a clean
context (without InitDX11) and SetEncoderParams succeeds, the first call to
CreateSurfaceFromHostNative(AMF_SURFACE_BGRA) triggers:

EAccessViolation: Write of address 0x0000000000000440
in module amfrtdrv64.dll at address 0x00007FFC7025BCAC

The crash address 0x440 is consistent across all sessions, suggesting a fixed struct
offset being written to an invalid pointer inside the driver.

To Reproduce

  1. Initialize AMF AVC encoder with DX11 context (InitDX11 on a Cezanne APU iGPU)
  2. Call CreateSurfaceFromDX11Native — it returns HR=0x00000011 (fails on Cezanne)
  3. Release the DX11 context, create a new clean context without InitDX11
  4. Call Component.Init with AMF_SURFACE_BGRA
  5. Call CreateSurfaceFromHostNative(AMF_SURFACE_BGRA, width, height, width*4, height,
    pBGRA, &surf, nullptr)
  6. Call Component.SubmitInput(surf) → EAccessViolation Write 0x440 in amfrtdrv64.dll

Workaround confirmed
FFmpeg h264_amf with hwdownload (CPU→AMF path) works correctly on the same hardware
with the same driver. This confirms the VCE hardware is functional — the bug is
specific to the direct AMF API path for HOST RAM surface submission.

Setup

  • OS: Windows 10 Build 26200 (25H2)
  • Driver Version: 31.0.21924.61 (Adrenalin, December 2025)
  • amfrt64.dll version: 1.4.31.0
  • GPU: AMD Ryzen 7 5700G — Cezanne APU, Radeon Vega 8 iGPU (VEN_1002 / DEV_1638)
  • No discrete GPU present
  • Which component has the issue: Encoder (AMFVideoEncoderVCE_AVC), HOST RAM pipeline

Additional context
The AMF runtime stub (amfrt64.dll) is only 4KB — actual encoding is delegated to
amfrtdrv64.dll which is where the crash occurs. The issue appears to be in how
amfrtdrv64.dll handles HOST memory surfaces on the Cezanne iGPU when the AMF context
has no DX11 state initialized. FFmpeg works around this by using a different internal
path (hwdownload filter before h264_amf), which never triggers the crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions