projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
64ea4a0
)
avformat/adxdec: check avctx->channels for invalid values
author
Andreas Cadhalpun
<Andreas.Cadhalpun@googlemail.com>
Wed, 25 Feb 2015 21:55:44 +0000
(22:55 +0100)
committer
Michael Niedermayer
<michaelni@gmx.at>
Thu, 26 Feb 2015 11:25:29 +0000
(12:25 +0100)
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>
libavformat/adxdec.c
patch
|
blob
|
history
diff --git
a/libavformat/adxdec.c
b/libavformat/adxdec.c
index
e57d051
..
e7107ac
100644
(file)
--- 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);