diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-05-03 12:44:17 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-05-18 12:20:19 +0400 |
commit | 3ef6c5264b2590781b4ed556443ff49709dd45fb (patch) | |
tree | 6546dce0ac39f79d5878c6ac8439ca2b8bc6ecfb /libavformat | |
parent | b136564909adec2043be4c94ade08b67ad443124 (diff) |
a64: check that extradata exists before reading from it
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/a64.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/a64.c b/libavformat/a64.c index 640e786836..da8e310496 100644 --- a/libavformat/a64.c +++ b/libavformat/a64.c @@ -35,6 +35,12 @@ static int a64_write_header(AVFormatContext *s) 0x00, //charset_lifetime (multi only) 0x00 //fps in 50/fps; }; + + if (avctx->extradata_size < 4) { + av_log(s, AV_LOG_ERROR, "Missing extradata\n"); + return AVERROR(EINVAL); + } + switch (avctx->codec->id) { case AV_CODEC_ID_A64_MULTI: header[2] = 0x00; |