Mercurial > libavcodec.hg
comparison msmpeg4.c @ 1063:fdeac9642346 libavcodec
check for qscale==0 (fixes 1/0 on one corrupted stream)
author | michaelni |
---|---|
date | Mon, 10 Feb 2003 22:43:30 +0000 |
parents | bb5de8a59da8 |
children | b32afefe7d33 |
comparison
equal
deleted
inserted
replaced
1062:e4c1df460506 | 1063:fdeac9642346 |
---|---|
1226 if(s->pict_type == I_TYPE) had_i=1; | 1226 if(s->pict_type == I_TYPE) had_i=1; |
1227 if(!had_i) return -1; | 1227 if(!had_i) return -1; |
1228 } | 1228 } |
1229 #endif | 1229 #endif |
1230 s->qscale = get_bits(&s->gb, 5); | 1230 s->qscale = get_bits(&s->gb, 5); |
1231 if(s->qscale==0){ | |
1232 fprintf(stderr, "invalid qscale\n"); | |
1233 return -1; | |
1234 } | |
1231 | 1235 |
1232 if (s->pict_type == I_TYPE) { | 1236 if (s->pict_type == I_TYPE) { |
1233 code = get_bits(&s->gb, 5); | 1237 code = get_bits(&s->gb, 5); |
1234 if(s->msmpeg4_version==1){ | 1238 if(s->msmpeg4_version==1){ |
1235 if(code==0 || code>s->mb_height){ | 1239 if(code==0 || code>s->mb_height){ |