From a28a5e26892adf56a0bb9b33de2fb76b2405cc97 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Sun, 28 Aug 2022 17:47:23 +0200
Subject: [PATCH] lavc/j2kdec: Do not ignore colour association for packed
formats.
Fixes ticket #9468.
---
libavcodec/jpeg2000dec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -2047,7 +2047,8 @@ static inline void 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 + \
+ (s->cdef[compno] ? s->cdef[compno] - 1 : compno) * !planar; \
\
if (codsty->transform == FF_DWT97) { \
for (; x < w; x++) { \
--
2.30.1