summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-11-18 12:29:05 +0000
committerPaul B Mahol <onemda@gmail.com>2012-11-18 12:29:05 +0000
commitd0a503c97cc59b17e77585a726448dfa46245f4d (patch)
tree0183216ed60ac3d3948432182dee6faea7554946 /libavformat
parentf5f29910dda982956a545896f2e685d5522722c3 (diff)
ast: check bit depth too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/ast.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/ast.c b/libavformat/ast.c
index a15054588f..2027b579c5 100644
--- a/libavformat/ast.c
+++ b/libavformat/ast.c
@@ -33,7 +33,7 @@ static int ast_probe(AVProbeData *p)
static int ast_read_header(AVFormatContext *s)
{
- int codec;
+ int codec, depth;
AVStream *st;
st = avformat_new_stream(s, NULL);
@@ -50,7 +50,11 @@ static int ast_read_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "unsupported codec %d\n", codec);
}
- avio_skip(s->pb, 2);
+ depth = avio_rb16(s->pb);
+ if (depth != 16) {
+ av_log_ask_for_sample(s, "unsupported depth %d\n", depth);
+ return AVERROR_INVALIDDATA;
+ }
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->channels = avio_rb16(s->pb);