diff xsubdec.c @ 10069:8ac9bc10b485 libavcodec

Always allocate a buffer of AVPALETTE_SIZE for palette in the subtitle decoders instead of as small as possible. This avoids completely unnecessary issues with e.g. libswscale.
author reimar
date Thu, 20 Aug 2009 18:54:50 +0000
parents 8ab9fbad11b2
children 8a4984c5cacc
line wrap: on
line diff
--- a/xsubdec.c	Wed Aug 19 21:59:44 2009 +0000
+++ b/xsubdec.c	Thu Aug 20 18:54:50 2009 +0000
@@ -95,7 +95,7 @@
     sub->rects[0]->pict.linesize[0] = w;
     sub->rects[0]->pict.data[0] = av_malloc(w * h);
     sub->rects[0]->nb_colors = 4;
-    sub->rects[0]->pict.data[1] = av_malloc(sub->rects[0]->nb_colors * 4);
+    sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
 
     // read palette
     for (i = 0; i < sub->rects[0]->nb_colors; i++)