mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 10:15:22 +00:00
wmaprodec: return an error, not 0, when the input is too small.
Returning 0 may result in an infinite loop in valid calling programs. A decoder should never return 0 without producing any output. CC:libav-stable@libav.org (cherry picked from commit4c0080b7e7
) Signed-off-by: Reinhard Tartler <siretart@tauware.de> (cherry picked from commit60dd8b5733
) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
d86a5ce03f
commit
5025dbc577
@ -1502,8 +1502,11 @@ static int decode_packet(AVCodecContext *avctx,
|
|||||||
s->packet_done = 0;
|
s->packet_done = 0;
|
||||||
|
|
||||||
/** sanity check for the buffer length */
|
/** sanity check for the buffer length */
|
||||||
if (buf_size < avctx->block_align)
|
if (buf_size < avctx->block_align) {
|
||||||
return 0;
|
av_log(avctx, AV_LOG_ERROR, "Input packet too small (%d < %d)\n",
|
||||||
|
buf_size, avctx->block_align);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
s->next_packet_start = buf_size - avctx->block_align;
|
s->next_packet_start = buf_size - avctx->block_align;
|
||||||
buf_size = avctx->block_align;
|
buf_size = avctx->block_align;
|
||||||
|
Loading…
Reference in New Issue
Block a user