[MPlayer-dev-eng] [PATCH]Do not overwrite palette with random extradata
Carl Eugen Hoyos
cehoyos at ag.or.at
Mon Dec 7 11:22:56 CET 2015
Hi!
I don't really know the underlying API but attached patch avoids overwriting
the palette side-data with extradata (that may or may not be a palette).
Please review, Carl Eugen
-------------- next part --------------
Index: libmpcodecs/vd_ffmpeg.c
===================================================================
--- libmpcodecs/vd_ffmpeg.c (revision 37561)
+++ libmpcodecs/vd_ffmpeg.c (working copy)
@@ -897,6 +897,9 @@
pkt.size = len;
// Necessary to decode e.g. CorePNG and ZeroCodec correctly
pkt.flags = (sh->ds->flags & 1) ? AV_PKT_FLAG_KEY : 0;
+ av_packet_split_side_data(&pkt);
+ if (av_packet_get_side_data(&pkt, AV_PKT_DATA_PALETTE, NULL))
+ ctx->palette_sent = 1;
if (!ctx->palette_sent && sh->bih && sh->bih->biBitCount <= 8) {
/* Pass palette to codec */
uint8_t *pal_data = (uint8_t *)(sh->bih+1);
More information about the MPlayer-dev-eng
mailing list