History

lavc/8bps: fix exporting palette after 63767b79a570404628b2521b83104108b7b6884c

It would be left empty on each frame whose packet does not come with palette attached.

Anton Khirnov committed 3 years ago

Commit 6dbde681 parent 72821371 file · +5 −1Browse files

Unified · Split

libavcodec/8bps.c+5−1
@@ -43,6 +43,8 @@ typedef struct EightBpsContext { · 42 unmodified lines
4343
4444 uint8_t planes;
4545 uint8_t planemap[4];
46+
47+ uint32_t pal[256];
4648 } EightBpsContext;
4749
4850 static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
@@ -116,10 +118,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 67 unmodified lines
116118 FF_DISABLE_DEPRECATION_WARNINGS
117119 frame->palette_has_changed =
118120 #endif
119− ff_copy_palette(frame->data[1], avpkt, avctx);
121+ ff_copy_palette(c->pal, avpkt, avctx);
120122 #if FF_API_PALETTE_HAS_CHANGED
121123 FF_ENABLE_DEPRECATION_WARNINGS
122124 #endif
125+
126+ memcpy(frame->data[1], c->pal, AVPALETTE_SIZE);
123127 }
124128
125129 *got_frame = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t