mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
avcodec/speexdec: check for sane frame_size values
Regression since ab39cc36c72bb73318bb911acb66873de850a107. Fixes heap buffer overflows Fixes ticket #10866 Reported-by: sploitem <sploitem@gmail.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
7ed1e806e7
commit
66b50445cb
@ -1420,7 +1420,10 @@ static int parse_speex_extradata(AVCodecContext *avctx,
|
||||
if (s->nb_channels <= 0 || s->nb_channels > 2)
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->bitrate = bytestream_get_le32(&buf);
|
||||
s->frame_size = (1 + (s->mode > 0)) * bytestream_get_le32(&buf);
|
||||
s->frame_size = bytestream_get_le32(&buf);
|
||||
if (s->frame_size < NB_FRAME_SIZE << (s->mode > 0))
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->frame_size *= 1 + (s->mode > 0);
|
||||
s->vbr = bytestream_get_le32(&buf);
|
||||
s->frames_per_packet = bytestream_get_le32(&buf);
|
||||
if (s->frames_per_packet <= 0 ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user