aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-03-27 00:44:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-03-27 00:45:32 +0200
commitd6eef545c1f576d798a8f07fbcec5cdfb2d950f6 (patch)
treee4cec61972d556998cd568ae4f451da9d6a42c5e
parent43fd3212521e3a44b99a6b1ef9bf9bcdddd086e8 (diff)
downloadffmpeg-d6eef545c1f576d798a8f07fbcec5cdfb2d950f6.tar.gz
vc1dec: move mquant zero check down.
This way it catches all cases, and prevents later segfaults. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vc1dec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 95597aa075..45c7f9df40 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1032,10 +1032,6 @@ static void vc1_mc_4mv_chroma4(VC1Context *v)
mquant = v->pq + mqdiff; \
else \
mquant = get_bits(gb, 5); \
- if (!mquant) { \
- av_log(v->s.avctx,AV_LOG_ERROR, "zero mquant\n"); \
- mquant = 1; \
- } \
} \
} \
if (v->dqprofile == DQPROFILE_SINGLE_EDGE) \
@@ -1052,6 +1048,10 @@ static void vc1_mc_4mv_chroma4(VC1Context *v)
mquant = v->altpq; \
if ((edges&8) && s->mb_y == (s->mb_height - 1)) \
mquant = v->altpq; \
+ if (!mquant) { \
+ av_log(v->s.avctx,AV_LOG_ERROR, "zero mquant\n"); \
+ mquant = 1; \
+ } \
}
/**