diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-02-25 22:55:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-26 12:25:29 +0100 |
commit | 7faa40af982960608b117e20fec999b48011e5e0 (patch) | |
tree | c4e32be3da045f76b94851c9bc7b2eaecaeb8ae4 | |
parent | 64ea4a0598e7ca61b95cf6c93fd409151a448001 (diff) | |
download | ffmpeg-7faa40af982960608b117e20fec999b48011e5e0.tar.gz |
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>
-rw-r--r-- | libavformat/adxdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index e57d0516dc..e7107ac579 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -40,6 +40,11 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt) AVCodecContext *avctx = s->streams[0]->codec; 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; pkt->pos = avio_tell(s->pb); |