Skip to content

Initialise J2KDecoder member variables#8

Open
lpartington wants to merge 2 commits intochafey:masterfrom
lpartington:lpp_decoder_init
Open

Initialise J2KDecoder member variables#8
lpartington wants to merge 2 commits intochafey:masterfrom
lpartington:lpp_decoder_init

Conversation

@lpartington
Copy link

The decoder member variables are not initialised, so the getXXX methods return essentially random values if decoding fails (the values are not entirely random in the WASM build - it appears that a J2KDecoder instance will sometimes be placed in the same location as a previous instance and will get whatever values that previous instance had, which can be very confusing).
Unfortunately the c++ test had to be modified as 'designated initializers' syntax is incompatible with a default constructor for FrameInfo. An alternative would be to initialize each member of FrameInfo in the J2KDecoder ctor but this seems a bit uglier to me.

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