mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-18 21:07:01 +00:00
avformat/adxdec: check avctx->channels for invalid values
This avoids a null pointer dereference of pkt->data. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
c89645c3ef
commit
f92e8cccf5
@ -41,6 +41,11 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
AVCodecContext *avctx = s->streams[0]->codec;
|
AVCodecContext *avctx = s->streams[0]->codec;
|
||||||
int ret, size;
|
int ret, size;
|
||||||
|
|
||||||
|
if (avctx->channels <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", avctx->channels);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
size = BLOCK_SIZE * avctx->channels;
|
size = BLOCK_SIZE * avctx->channels;
|
||||||
|
|
||||||
pkt->pos = avio_tell(s->pb);
|
pkt->pos = avio_tell(s->pb);
|
||||||
|
Loading…
Reference in New Issue
Block a user