diff mbox series

[FFmpeg-devel] lavc/j2kdec: Do not ignore colour association for packed formats

Message ID CAB0OVGqQAawMRvTy+-c+zoHGo1UNXdPby_JYi9KtEkemP+AaHA@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] lavc/j2kdec: Do not ignore colour association for packed formats | expand

Commit Message

Carl Eugen Hoyos Aug. 28, 2022, 3:52 p.m. UTC
Hi everybody!

Attached patch fixes ticket #9468 for me.

Please review, Carl Eugen
diff mbox series

Patch

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(-)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 2c1191035c..c6187d6c43 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -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