From dee138624fdf0997a46f04672f0ec50782403e45 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 8 Apr 2016 23:35:45 +0200 Subject: [PATCH] avcodec/shorten: fix decoding of files with number of samples lower than max_frame_size Note that support of very big block sizes is not currently supported at all due too flawed logic in decoder. Signed-off-by: Paul B Mahol --- libavcodec/shorten.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 9de6bd1c2d..0dc879a58c 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -476,8 +476,10 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, if (!s->got_header) { if ((ret = read_header(s)) < 0) return ret; - *got_frame_ptr = 0; - goto finish_frame; + if (avpkt->size) { + *got_frame_ptr = 0; + goto finish_frame; + } } /* if quit command was read previously, don't decode anything */