comparison dvbsubdec.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 c78fd9154378
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10068:770294452eaf 10069:8ac9bc10b485
1312 default: 1312 default:
1313 clut_table = clut->clut16; 1313 clut_table = clut->clut16;
1314 break; 1314 break;
1315 } 1315 }
1316 1316
1317 rect->pict.data[1] = av_malloc((1 << region->depth) * sizeof(uint32_t)); 1317 rect->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
1318 memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(uint32_t)); 1318 memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(uint32_t));
1319 1319
1320 rect->pict.data[0] = av_malloc(region->buf_size); 1320 rect->pict.data[0] = av_malloc(region->buf_size);
1321 memcpy(rect->pict.data[0], region->pbuf, region->buf_size); 1321 memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
1322 1322