mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/midivid: Perform lzss_uncompress() before ff_reget_buffer()
This would avoid regeting the frame on lzss errors
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 628fb97efb
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1cd07b178b
commit
550fd2212d
@ -203,12 +203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
bytestream2_skip(gb, 8);
|
||||
uncompressed = bytestream2_get_le32(gb);
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
if (uncompressed) {
|
||||
ret = decode_mvdv(s, avctx, frame);
|
||||
} else {
|
||||
if (!uncompressed) {
|
||||
av_fast_padded_malloc(&s->uncompressed, &s->uncompressed_size, 16LL * (avpkt->size - 12));
|
||||
if (!s->uncompressed)
|
||||
return AVERROR(ENOMEM);
|
||||
@ -217,9 +212,13 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
bytestream2_init(gb, s->uncompressed, ret);
|
||||
ret = decode_mvdv(s, avctx, frame);
|
||||
}
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
ret = decode_mvdv(s, avctx, frame);
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
key = ret;
|
||||
|
Loading…
Reference in New Issue
Block a user