summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-01-23 19:32:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-01-23 19:32:26 +0000
commit08eb8fcdbfdd4d32e0177c9aff580022ca102fc8 (patch)
tree86e619dfc2c6209d164d1a21b59df7c86af85285 /libavcodec/h264.c
parent79a5b35c05cfa3c269560069ba142a0d7dc4bacc (diff)
fix segfault with darkkben.free.fr/corrupted_h264.mp4
Originally committed as revision 7671 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2d75aaa76a..d696676f02 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4889,8 +4889,8 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
if(total_coeff==0)
return 0;
- if(total_coeff<0) {
- av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff<0)\n", s->mb_x, s->mb_y);
+ if(total_coeff > (unsigned)max_coeff) {
+ av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff=%d)\n", s->mb_x, s->mb_y, total_coeff);
return -1;
}