if (context->buffer) {
int i;
uint8_t *dst = context->buffer;
- buf_size = context->length - 256*4;
+ buf_size = context->length - AVPALETTE_SIZE;
if (avctx->bits_per_coded_sample == 4){
for(i=0; 2*i+1 < buf_size && i<avpkt->size; i++){
dst[2*i+0]= buf[i]>>4;
avctx->codec_tag == MKTAG('A', 'V', 'u', 'p'))
buf += buf_size - context->length;
- len = context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0);
+ len = context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0);
if (buf_size < len) {
av_log(avctx, AV_LOG_ERROR, "Invalid buffer size, packet size %d < expected length %d\n", buf_size, len);
return AVERROR(EINVAL);