Web lists-archives.com

[MPlayer-dev-eng] [PATCH]Do not overwrite palette with random extradata




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
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);
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng