summaryrefslogtreecommitdiff
path: root/libavcodec/tscc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/tscc.c')
-rw-r--r--libavcodec/tscc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index f69597369a..bd05f02a61 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -60,6 +60,8 @@ typedef struct TsccContext {
unsigned char* decomp_buf;
int height;
z_stream zstream;
+
+ uint32_t pal[256];
} CamtasiaContext;
/*
@@ -111,11 +113,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
/* make the palette available on the way out */
if (c->avctx->pix_fmt == PIX_FMT_PAL8) {
- memcpy(c->pic.data[1], c->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (c->avctx->palctrl->palette_changed) {
+ const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
+
+ if (pal) {
c->pic.palette_has_changed = 1;
- c->avctx->palctrl->palette_changed = 0;
+ memcpy(c->pal, pal, AVPALETTE_SIZE);
}
+ memcpy(c->pic.data[1], c->pal, AVPALETTE_SIZE);
}
*data_size = sizeof(AVFrame);