Commit 3bf1d787 authored by Michael Niedermayer's avatar Michael Niedermayer

adx_parser: Fix infinite loop.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1af0ace3
...@@ -56,7 +56,6 @@ static int adx_parse(AVCodecParserContext *s1, ...@@ -56,7 +56,6 @@ static int adx_parse(AVCodecParserContext *s1,
if (ret = avpriv_adx_decode_header(avctx, pc->buffer, pc->index, if (ret = avpriv_adx_decode_header(avctx, pc->buffer, pc->index,
&s->header_size, NULL)) &s->header_size, NULL))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
s->block_size = BLOCK_SIZE * avctx->channels;
} }
if (s->header_size && s->header_size <= pc->index) { if (s->header_size && s->header_size <= pc->index) {
avctx->extradata = av_mallocz(s->header_size + FF_INPUT_BUFFER_PADDING_SIZE); avctx->extradata = av_mallocz(s->header_size + FF_INPUT_BUFFER_PADDING_SIZE);
...@@ -71,6 +70,7 @@ static int adx_parse(AVCodecParserContext *s1, ...@@ -71,6 +70,7 @@ static int adx_parse(AVCodecParserContext *s1,
*poutbuf_size = 0; *poutbuf_size = 0;
return buf_size; return buf_size;
} }
s->block_size = BLOCK_SIZE * avctx->channels;
if (pc->index - s->buf_pos >= s->block_size) { if (pc->index - s->buf_pos >= s->block_size) {
*poutbuf = &pc->buffer[s->buf_pos]; *poutbuf = &pc->buffer[s->buf_pos];
......
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