summaryrefslogtreecommitdiff
path: root/libavcodec/8bps.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-24 15:03:51 +0200
committerAnton Khirnov <anton@khirnov.net>2023-11-14 18:18:26 +0100
commit6dbde68cb5467302fe99c331ea9b14d824238016 (patch)
treeef93bb58f9470977b37d07f41d7d06193f23e6bc /libavcodec/8bps.c
parent7282137f48c3e71734a2aa55c51b3096a1a63b5f (diff)
lavc/8bps: fix exporting palette after 63767b79a570404628b2521b83104108b7b6884c
It would be left empty on each frame whose packet does not come with palette attached.
Diffstat (limited to 'libavcodec/8bps.c')
-rw-r--r--libavcodec/8bps.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c
index 0becaa9320..11b9f526b7 100644
--- a/libavcodec/8bps.c
+++ b/libavcodec/8bps.c
@@ -43,6 +43,8 @@ typedef struct EightBpsContext {
uint8_t planes;
uint8_t planemap[4];
+
+ uint32_t pal[256];
} EightBpsContext;
static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
@@ -116,10 +118,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
FF_DISABLE_DEPRECATION_WARNINGS
frame->palette_has_changed =
#endif
- ff_copy_palette(frame->data[1], avpkt, avctx);
+ ff_copy_palette(c->pal, avpkt, avctx);
#if FF_API_PALETTE_HAS_CHANGED
FF_ENABLE_DEPRECATION_WARNINGS
#endif
+
+ memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
}
*got_frame = 1;