avcodec/shorten: fix decoding of files with number of samples lower than max_frame_size
authorPaul B Mahol <onemda@gmail.com>
Fri, 8 Apr 2016 21:35:45 +0000 (23:35 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 8 Apr 2016 21:45:09 +0000 (23:45 +0200)
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 <onemda@gmail.com>
libavcodec/shorten.c

index 9de6bd1..0dc879a 100644 (file)
@@ -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 */