| 113 | } |
| 114 | |
| 115 | static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end) |
| 116 | { |
| 117 | int pal_start, pal_count, i; |
| 118 | |
| 119 | if(buf+16>=buf_end) { |
| 120 | av_log(s->avctx, AV_LOG_WARNING, "truncated header\n"); |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | s->width = AV_RL16(&buf[4]); |
| 125 | s->height = AV_RL16(&buf[6]); |
| 126 | if (s->avctx->width!=s->width || s->avctx->height!=s->height) |
| 127 | avcodec_set_dimensions(s->avctx, s->width, s->height); |
| 128 | |
| 129 | s->avctx->time_base.num = 1; |
| 130 | s->avctx->time_base.den = AV_RL16(&buf[10]); |
| 131 | |
| 132 | pal_start = AV_RL16(&buf[12]); |
| 133 | pal_count = AV_RL16(&buf[14]); |
| 134 | |
| 135 | buf += 16; |
| 136 | for (i=pal_start; i<pal_start+pal_count && i<AVPALETTE_COUNT && buf+2<buf_end; i++) { |
| 137 | s->palette[i] = AV_RB24(buf); |
| 138 | buf += 3; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | #define EA_PREAMBLE_SIZE 8 |
| 143 | #define MVIh_TAG MKTAG('M', 'V', 'I', 'h') |
no test coverage detected