Commit bb39bd19 authored by Kostya Shishkov's avatar Kostya Shishkov

zmbv: check decompress result

Changing flush type from Z_FINISH is needed since encoder compresses fixed
amount of data and doesn't care about writing end of stream marker.
parent afc2263b
...@@ -512,7 +512,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -512,7 +512,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->zstream.avail_in = len; c->zstream.avail_in = len;
c->zstream.next_out = c->decomp_buf; c->zstream.next_out = c->decomp_buf;
c->zstream.avail_out = c->decomp_size; c->zstream.avail_out = c->decomp_size;
inflate(&c->zstream, Z_FINISH); zret = inflate(&c->zstream, Z_SYNC_FLUSH);
if (zret != Z_OK && zret != Z_STREAM_END) {
av_log(avctx, AV_LOG_ERROR, "inflate error %d\n", zret);
return AVERROR_INVALIDDATA;
}
c->decomp_len = c->zstream.total_out; c->decomp_len = c->zstream.total_out;
} }
if (c->flags & ZMBV_KEYFRAME) { if (c->flags & ZMBV_KEYFRAME) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment