It would be left empty on each frame whose packet does not come with palette attached.
Unified · Split
| @@ -43,6 +43,8 @@ typedef struct EightBpsContext { · 42 unmodified lines | ||
| 43 | 43 | |
| 44 | 44 | uint8_t planes; |
| 45 | 45 | uint8_t planemap[4]; |
| 46 | + | |
| 47 | + uint32_t pal[256]; | |
| 46 | 48 | } EightBpsContext; |
| 47 | 49 | |
| 48 | 50 | static int decode_frame(AVCodecContext *avctx, AVFrame *frame, |
| @@ -116,10 +118,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 67 unmodified lines | ||
| 116 | 118 | FF_DISABLE_DEPRECATION_WARNINGS |
| 117 | 119 | frame->palette_has_changed = |
| 118 | 120 | #endif |
| 119 | − ff_copy_palette(frame->data[1], avpkt, avctx); | |
| 121 | + ff_copy_palette(c->pal, avpkt, avctx); | |
| 120 | 122 | #if FF_API_PALETTE_HAS_CHANGED |
| 121 | 123 | FF_ENABLE_DEPRECATION_WARNINGS |
| 122 | 124 | #endif |
| 125 | + | |
| 126 | + memcpy(frame->data[1], c->pal, AVPALETTE_SIZE); | |
| 123 | 127 | } |
| 124 | 128 | |
| 125 | 129 | *got_frame = 1; |