[FFmpeg-cvslog] avformat/adxdec: check avctx->channels for invalid values

Andreas Cadhalpun git at videolan.org
Sat Mar 14 14:41:10 CET 2015


ffmpeg | branch: release/2.2 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Feb 25 22:55:44 2015 +0100| [3193f4d3f2a6ad982d4fdbb4dc226ea8d81572b7] | committer: Michael Niedermayer

avformat/adxdec: check avctx->channels for invalid values

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3193f4d3f2a6ad982d4fdbb4dc226ea8d81572b7
---

 libavformat/adxdec.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c
index fe22c3a..b577b89 100644
--- a/libavformat/adxdec.c
+++ b/libavformat/adxdec.c
@@ -41,6 +41,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);



More information about the ffmpeg-cvslog mailing list