|
|
|
@ -54,6 +54,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, |
|
|
|
|
int w, h, x, y, rlelen, i; |
|
|
|
|
int64_t packet_time = 0; |
|
|
|
|
GetBitContext gb; |
|
|
|
|
int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); |
|
|
|
|
|
|
|
|
|
// check that at least header fits
|
|
|
|
|
if (buf_size < 27 + 7 * 2 + 4 * 3) { |
|
|
|
@ -100,8 +101,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, |
|
|
|
|
for (i = 0; i < sub->rects[0]->nb_colors; i++) |
|
|
|
|
((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf); |
|
|
|
|
// make all except background (first entry) non-transparent
|
|
|
|
|
for (i = 1; i < sub->rects[0]->nb_colors; i++) |
|
|
|
|
((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff000000; |
|
|
|
|
for (i = 0; i < sub->rects[0]->nb_colors; i++) |
|
|
|
|
((uint32_t*)sub->rects[0]->pict.data[1])[i] |= (has_alpha ? *buf++ : (i ? 0xff : 0)) << 24; |
|
|
|
|
|
|
|
|
|
// process RLE-compressed data
|
|
|
|
|
rlelen = FFMIN(rlelen, buf_end - buf); |
|
|
|
|