return AVERROR_INVALIDDATA;
}
- if (*buf == 0xFF) {
+ if (*buf == 0xFF || bpp == 8) {
buf += 2;
etype = bytestream_get_le16(&buf);
esize = bytestream_get_le16(&buf);
buf += esize;
- x = 0;
y = s->height - 1;
- plane = 0;
if (bytestream_get_le16(&buf)) {
+ x = 0;
+ plane = 0;
while (y >= 0 && buf_end - buf >= 6) {
const uint8_t *buf_pend = buf + FFMIN(AV_RL16(buf), buf_end - buf);
//ignore uncompressed block size reported at buf[2]
}
}
} else {
- av_log_ask_for_sample(avctx, "uncompressed image\n");
- return buf_size;
+ while (y >= 0 && buf < buf_end) {
+ memcpy(s->frame.data[0] + y * s->frame.linesize[0], buf, FFMIN(avctx->width, buf_end - buf));
+ buf += avctx->width;
+ y--;
+ }
}
*data_size = sizeof(AVFrame);
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_PICTOR,
.priv_data_size = sizeof(PicContext),
- decode_init,
+ .init = decode_init,
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,