swscale/internal: use static_assert for enforcing offsets

Instead of sprinkling av_assert0 into random init functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas 2024-10-10 11:57:44 +02:00
parent 55d5eae411
commit 10d1be2621
3 changed files with 11 additions and 6 deletions

View file

@ -1228,8 +1228,6 @@ SwsContext *sws_alloc_context(void)
{
SwsInternal *c = av_mallocz(sizeof(SwsInternal));
av_assert0(offsetof(SwsInternal, redDither) + DITHER32_INT == offsetof(SwsInternal, dither32));
if (c) {
c->av_class = &ff_sws_context_class;
av_opt_set_defaults(c);