34 #define SMACKER_PAL 0x01
35 #define SMACKER_FLAG_RING_FRAME 0x01
84 0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
85 0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
86 0x41, 0x45, 0x49, 0x4D, 0x51, 0x55, 0x59, 0x5D,
87 0x61, 0x65, 0x69, 0x6D, 0x71, 0x75, 0x79, 0x7D,
88 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9A, 0x9E,
89 0xA2, 0xA6, 0xAA, 0xAE, 0xB2, 0xB6, 0xBA, 0xBE,
90 0xC3, 0xC7, 0xCB, 0xCF, 0xD3, 0xD7, 0xDB, 0xDF,
91 0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF
126 for(i = 0; i < 7; i++)
140 for(i = 0; i < 7; i++) {
146 if(smk->
frames > 0xFFFFFF) {
161 for(i = 0; i < smk->
frames; i++) {
164 for(i = 0; i < smk->
frames; i++) {
189 for(i = 0; i < 7; i++) {
227 "Cannot allocate %"PRIu32
" bytes of extradata\n",
270 int size, sz, t, off, j, pos;
274 memcpy(oldpal, pal, 768);
277 if(size + 1 > frame_size)
286 sz += (t & 0x7F) + 1;
287 pal += ((t & 0x7F) + 1) * 3;
291 if (off + j > 0x100) {
293 "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
298 while(j-- && sz < 256) {
299 *pal++ = oldpal[off + 0];
300 *pal++ = oldpal[off + 1];
301 *pal++ = oldpal[off + 2];
318 for(i = 0; i < 7; i++) {
324 if (!size || size + 4LL > frame_size) {
343 if (frame_size < 0 || frame_size >= INT_MAX/2)
349 pkt->
data[0] = palchange;
350 memcpy(pkt->
data + 1, smk->
pal, 768);
352 if(ret != frame_size)
356 pkt->
size = ret + 769;
380 for(i = 0; i < 7; i++)