[FFmpeg-cvslog] avcodec/jpeglsdec: Set alpha plane in PAL8 so image is not 100% transparent

Michael Niedermayer git at videolan.org
Fri Jun 18 22:14:00 EEST 2021


ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun May  2 15:49:55 2021 +0200| [1abd61e006d81503dba61f75c725723e2ebc98f8] | committer: Michael Niedermayer

avcodec/jpeglsdec: Set alpha plane in PAL8 so image is not 100% transparent

Fixes: tickets/3933/128.jls

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 011006874cb46325b6bc83234f81879ff421c05f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1abd61e006d81503dba61f75c725723e2ebc98f8
---

 libavcodec/jpeglsdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
index 69980eaa49..c4ffa81f7d 100644
--- a/libavcodec/jpeglsdec.c
+++ b/libavcodec/jpeglsdec.c
@@ -122,7 +122,7 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
             s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
             for (i=s->palette_index; i<=maxtab; i++) {
                 uint8_t k = i << shift;
-                pal[k] = 0;
+                pal[k] = wt < 4 ? 0xFF000000 : 0;
                 for (j=0; j<wt; j++) {
                     pal[k] |= get_bits(&s->gb, 8) << (8*(wt-j-1));
                 }



More information about the ffmpeg-cvslog mailing list