summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-08-20 18:54:50 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-08-20 18:54:50 +0000
commit29d7eef7dcfaf6cc6c97ac154e54c89f77507d86 (patch)
tree018a1dda8b58075ed8149ae8cc419bef8ec82307 /libavcodec/dvdsubdec.c
parent1b03a9d6073b3a4c62a44b56852762eb4b382dc4 (diff)
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. Originally committed as revision 19673 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 49b0802f58..142241217c 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -318,14 +318,13 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
buf, offset1, buf_size, is_8bit);
decode_rle(bitmap + w, w * 2, w, h / 2,
buf, offset2, buf_size, is_8bit);
+ sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
if (is_8bit) {
if (yuv_palette == 0)
goto fail;
- sub_header->rects[0]->pict.data[1] = av_malloc(256 * 4);
sub_header->rects[0]->nb_colors = 256;
yuv_a_to_rgba(yuv_palette, alpha, (uint32_t*)sub_header->rects[0]->pict.data[1], 256);
} else {
- sub_header->rects[0]->pict.data[1] = av_malloc(4 * 4);
sub_header->rects[0]->nb_colors = 4;
guess_palette((uint32_t*)sub_header->rects[0]->pict.data[1],
colormap, alpha, 0xffff00);