Commit 97c281d5 authored by Michael Niedermayer's avatar Michael Niedermayer

ffv1: fix crash caused by version becoming inconsistent

Fixes part of Ticket1372
Found-by: 's avatarPiotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0bae6661
......@@ -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++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment