comparison pgssubdec.c @ 10092:e85fbfe709d8 libavcodec

Always allocate a buffer of AVPALETTE_SIZE for palette in the Bluray subtitle decoder instead of as small as possible. This avoids completely unnecessary issues with e.g. libswscale. (See r19673) Patch by Stephen Backway, stev391 A exemail D com D au
author cehoyos
date Wed, 26 Aug 2009 11:31:37 +0000
parents b9247f1debb2
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10091:8e1fbf9b0858 10092:e85fbfe709d8
365 if(decode_rle(avctx, sub, ctx->picture.rle, ctx->picture.rle_data_len) < 0) 365 if(decode_rle(avctx, sub, ctx->picture.rle, ctx->picture.rle_data_len) < 0)
366 return 0; 366 return 0;
367 367
368 /* Allocate memory for colors */ 368 /* Allocate memory for colors */
369 sub->rects[0]->nb_colors = 256; 369 sub->rects[0]->nb_colors = 256;
370 sub->rects[0]->pict.data[1] = av_malloc(sub->rects[0]->nb_colors * sizeof(uint32_t)); 370 sub->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
371 371
372 memcpy(sub->rects[0]->pict.data[1], ctx->clut, sub->rects[0]->nb_colors * sizeof(uint32_t)); 372 memcpy(sub->rects[0]->pict.data[1], ctx->clut, sub->rects[0]->nb_colors * sizeof(uint32_t));
373 373
374 return 1; 374 return 1;
375 } 375 }