36 void *
data,
int *data_size,
39 const uint8_t *buf = avpkt->
data;
40 const uint8_t *buf_end = avpkt->
data + avpkt->
size;
41 int buf_size = avpkt->
size;
63 if (buf_end - buf < 0x68 + 4)
69 if(colors < 0 || colors > 256) {
73 if (buf_end - buf < (colors + 1) * 8)
76 pal = (uint32_t*)p->
data[1];
77 for (i = 0; i <= colors; i++) {
93 pal[idx] = (r << 16) | (
g << 8) |
b;
97 if (buf_end - buf < 18)
100 for (i = 0; i < avctx->
height; i++) {
101 int size, left, code, pix;
110 if (buf_end - buf < size)
119 if ((out + (257 - code)) > (outdata + a->
pic.
linesize[0]))
121 memset(out, pix, 257 - code);
128 if (buf_end - buf < code + 1)
130 memcpy(out, buf, code + 1);