uint8_t header_buffer[128] = { 0 }; /* logical maximum header size */
const uint8_t *buf = avpkt->data;
int size = avpkt->size;
- int i;
+ int width, height;
+ int ret, i;
if (size < 1) {
av_log(avctx, AV_LOG_ERROR, "input packet too small (%d)\n", size);
if (s->delta_size < 2 || s->delta_size > 4)
return AVERROR_INVALIDDATA;
- avctx->height = AV_RL16(header_buffer + 5);
- avctx->width = AV_RL16(header_buffer + 7);
+ height = AV_RL16(header_buffer + 5);
+ width = AV_RL16(header_buffer + 7);
+
+ ret = ff_set_dimensions(avctx, width, height);
+ if (ret < 0)
+ return ret;
av_log(avctx, AV_LOG_DEBUG, "Header size: %d\n", header_size);
return header_size;