"Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",
c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
if (hi_ver != 0 || lo_ver != 1) {
- av_log_ask_for_sample(avctx, "Unsupported version %i.%i\n",
- hi_ver, lo_ver);
+ avpriv_request_sample(avctx, "Version %i.%i", hi_ver, lo_ver);
return AVERROR_PATCHWELCOME;
}
if (c->bw == 0 || c->bh == 0) {
- av_log_ask_for_sample(avctx, "Unsupported block size %ix%i\n",
- c->bw, c->bh);
+ avpriv_request_sample(avctx, "Block size %ix%i", c->bw, c->bh);
return AVERROR_PATCHWELCOME;
}
if (c->comp != 0 && c->comp != 1) {
- av_log_ask_for_sample(avctx, "Unsupported compression type %i\n",
- c->comp);
+ avpriv_request_sample(avctx, "Compression type %i", c->comp);
return AVERROR_PATCHWELCOME;
}
default:
c->decode_intra = NULL;
c->decode_xor = NULL;
- av_log_ask_for_sample(avctx, "Unsupported (for now) format %i\n",
- c->fmt);
+ avpriv_request_sample(avctx, "Format %i", c->fmt);
return AVERROR_PATCHWELCOME;
}
}
if (c->comp == 0) { //Uncompressed data
+ if (c->decomp_size < len) {
+ av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
+ return AVERROR_INVALIDDATA;
+ }
memcpy(c->decomp_buf, buf, len);
- c->decomp_size = 1;
} else { // ZLIB-compressed data
c->zstream.total_in = c->zstream.total_out = 0;
c->zstream.next_in = buf;
AVCodec ff_zmbv_decoder = {
.name = "zmbv",
+ .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_ZMBV,
.priv_data_size = sizeof(ZmbvContext),
.close = decode_end,
.decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
};