aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-30 03:43:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-08-31 04:31:04 +0200
commit890c36d7ff1a12641c9fe5c84db4398dfb493fc5 (patch)
treea4e723767cac23b044eed6c274c786612f34efcf
parenta2e7fd406c5b1d9095fe198c72007e4136ef5e93 (diff)
downloadffmpeg-890c36d7ff1a12641c9fe5c84db4398dfb493fc5.tar.gz
avcodec/ffv1dec: check global header version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 20b965a1a43ae88b7ae95635d5a3570e7dc2bbd4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/ffv1dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index a1da544697..69930d8ea8 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -447,6 +447,10 @@ static int read_extra_header(FFV1Context *f)
ff_build_rac_states(c, 0.05 * (1LL << 32), 256 - 8);
f->version = get_symbol(c, state, 0);
+ if (f->version < 2) {
+ av_log(f->avctx, AV_LOG_ERROR, "Invalid version in global header\n");
+ return AVERROR_INVALIDDATA;
+ }
if (f->version > 2) {
c->bytestream_end -= 4;
f->minor_version = get_symbol(c, state, 0);