diff options
author | James Almer <jamrial@gmail.com> | 2015-05-24 01:24:32 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2015-05-24 13:06:42 -0300 |
commit | c5a07f1f8404d61a344662d1cc430b1a708a9dae (patch) | |
tree | 3842af1064156472b92b81f3b6597227e6df0a8a | |
parent | db5ea69d80d9461ab3f3748b5942cc14d13b523b (diff) | |
download | ffmpeg-c5a07f1f8404d61a344662d1cc430b1a708a9dae.tar.gz |
libdcadec: search for frames that start late in a packet
Based on commit 4ae15605f6298d8369a1f1374596b52a3839c703
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/libdcadec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c index 9ea61fa872..890d27091d 100644 --- a/libavcodec/libdcadec.c +++ b/libavcodec/libdcadec.c @@ -58,7 +58,10 @@ static int dcadec_decode_frame(AVCodecContext *avctx, void *data, if (!s->buffer) return AVERROR(ENOMEM); - if ((ret = avpriv_dca_convert_bitstream(avpkt->data, avpkt->size, s->buffer, s->buffer_size)) < 0) + for (i = 0, ret = AVERROR_INVALIDDATA; i < input_size - 3 && ret < 0; i++) + ret = avpriv_dca_convert_bitstream(input + i, input_size - i, s->buffer, s->buffer_size); + + if (ret < 0) return ret; input = s->buffer; |