diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-02 04:21:30 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-02 04:30:55 +0400 |
commit | 97c281d5b7d1c4850a8ba7d9921137634224b2f3 (patch) | |
tree | 2088d97c8478585c1abd9a9fb98f7f2aa4a0048b /libavcodec/ffv1.c | |
parent | 0bae6661cd171abf55cfa4b8970b08c470d65dee (diff) |
ffv1: fix crash caused by version becoming inconsistent
Fixes part of Ticket1372
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ffv1.c')
-rw-r--r-- | libavcodec/ffv1.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index bffd744937..79409e2a16 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -1769,7 +1769,12 @@ static int read_header(FFV1Context *f){ memset(state, 128, sizeof(state)); if(f->version < 2){ - f->version= get_symbol(c, state, 0); + unsigned v= get_symbol(c, state, 0); + if(v >= 2){ + av_log(f->avctx, AV_LOG_ERROR, "invalid version %d in ver01 header\n", v); + return AVERROR_INVALIDDATA; + } + f->version = v; f->ac= f->avctx->coder_type= get_symbol(c, state, 0); if(f->ac>1){ for(i=1; i<256; i++){ |