Skip to content

Fix direct modifications of decoder->image.#3281

Merged
maryla-uc merged 2 commits into
AOMediaCodec:mainfrom
maryla-uc:fixbadapi
Jul 1, 2026
Merged

Fix direct modifications of decoder->image.#3281
maryla-uc merged 2 commits into
AOMediaCodec:mainfrom
maryla-uc:fixbadapi

Conversation

@maryla-uc

Copy link
Copy Markdown
Contributor

Directly modifying it goes against the API contract. Create views instead.

#3277

Directly modifying it goes against the API contract.
Create views instead.
@maryla-uc

Copy link
Copy Markdown
Contributor Author

Rebased on top of #3283

Comment thread apps/avifdec.c
Comment thread apps/avifdec.c Outdated
Comment thread apps/avifdec.c Outdated
Comment thread apps/avifdec.c Outdated
Comment thread apps/avifdec.c
Comment thread apps/avifdec.c Outdated
Comment thread apps/shared/avifutil.h
// If a gain map is present in 'srcImage', the gain map of 'dstImage' is also set to
// a view of the original gain map.
// 'dstImage' should be an empty image. It will not own the pixel data.
avifResult avifImageCreateView(avifImage * dstImage, const avifImage * srcImage, avifBool ignoreColorProfile, avifBool ignoreAlpha, avifBool ignoreGainMap);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future: This function probably should be moved to the libavif library.

Also, some of the ignore* parameters could be handled by new avifDecoder options or by the caller, for example,

We can deal with this iteratively.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we wanted to stop adding new features to libavif...

Comment thread apps/shared/avifutil.c

@wantehchang wantehchang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@maryla-uc maryla-uc merged commit 287bddd into AOMediaCodec:main Jul 1, 2026
30 of 31 checks passed
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.

2 participants