lavc/j2kdec: Do not ignore colour association for packed formats

Fixes ticket #9468.

Signed-off-by: Carl Eugen Hoyos <ceffmpeg@gmail.com
(cherry picked from commit aab0c23cb8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Carl Eugen Hoyos 2026-01-04 23:50:53 +03:00 committed by Michael Niedermayer
parent d113bd7317
commit 45f7e076e6
No known key found for this signature in database
GPG key ID: B18E8928B3948D64

View file

@ -2317,9 +2317,12 @@ static inline int tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile
int h = tile->comp[compno].coord[1][1] - \
ff_jpeg2000_ceildiv(s->image_offset_y, s->cdy[compno]); \
int plane = 0; \
ptrdiff_t dstoffset = 0; \
\
if (planar) \
plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1); \
else \
dstoffset = s->cdef[compno] ? s->cdef[compno] - 1 : compno; \
\
y = tile->comp[compno].coord[1][0] - \
ff_jpeg2000_ceildiv(s->image_offset_y, s->cdy[compno]); \
@ -2329,7 +2332,7 @@ static inline int tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile
\
x = tile->comp[compno].coord[0][0] - \
ff_jpeg2000_ceildiv(s->image_offset_x, s->cdx[compno]); \
dst = line + x * pixelsize + compno*!planar; \
dst = line + x * pixelsize + dstoffset; \
\
if (codsty->transform == FF_DWT97) { \
for (; x < w; x++) { \