AVFrame * const p = data;
GetByteContext gbc;
int colors;
- int w, h, x0, y0, x1, y1, ret;
+ int w, h, ret;
int ver;
bytestream2_init(&gbc, avpkt->data, avpkt->size);
switch(opcode) {
case CLIP:
- bytestream2_get_be16(&gbc);
- y0 = bytestream2_get_be16(&gbc);
- x0 = bytestream2_get_be16(&gbc);
- y1 = bytestream2_get_be16(&gbc);
- x1 = bytestream2_get_be16(&gbc);
- ret = ff_set_dimensions(avctx, x1 - x0, y1 - y0);
- if (ret < 0)
- return ret;
+ bytestream2_skip(&gbc, 10);
break;
case PACKBITSRECT:
case PACKBITSRGN:
return AVERROR_PATCHWELCOME;
}
- bytestream2_skip(&gbc, 10);
+ bytestream2_skip(&gbc, 4);
+ h = bytestream2_get_be16(&gbc);
+ w = bytestream2_get_be16(&gbc);
+ bytestream2_skip(&gbc, 2);
+
+ ret = ff_set_dimensions(avctx, w, h);
+ if (ret < 0)
+ return ret;
+
pack_type = bytestream2_get_be16(&gbc);
bytestream2_skip(&gbc, 16);