Skip to content

[ffmpeg] Avoid empty type array which cause a msvc ICE#51571

Draft
xiaozhuai wants to merge 1 commit intomicrosoft:masterfrom
xiaozhuai:dev-ffmpeg
Draft

[ffmpeg] Avoid empty type array which cause a msvc ICE#51571
xiaozhuai wants to merge 1 commit intomicrosoft:masterfrom
xiaozhuai:dev-ffmpeg

Conversation

@xiaozhuai
Copy link
Copy Markdown
Contributor

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version, or no changes were necessary.
  • Any fixed CI baseline and CI feature baseline entries are removed from that file, or no entries needed to be changed.
  • All patch files in the port are applied and succeed.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Exactly one version is added in each modified versions file.

libavformat/cbs.c includes this file with a different set of CBS_* macros. In configurations using --disable-everything, all coded bitstream types may be disabled for that instance, leaving cbs_type_table empty.

This triggers a zero-sized array warning with MSVC and may lead to an internal compiler error with optimization enabled.

Add a NULL terminator and iterate until the terminator instead of using FF_ARRAY_ELEMS(). The runtime behavior is unchanged.

The code currently permits building an instance of cbs.c with no enabled coded bitstream types. In that case the generated table is empty. Make the table explicitly NULL-terminated so this configuration is valid C for compilers that reject or mishandle empty arrays.

@xiaozhuai
Copy link
Copy Markdown
Contributor Author

xiaozhuai commented May 6, 2026

I've send the patch to the upstream. Please do not merge this PR until it has been reviewed by the upstream.
A link to track the status of the upstream PR will be added once it becomes available.

@xiaozhuai xiaozhuai marked this pull request as draft May 6, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant