aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorMashiat Sarker Shakkhar <shahriman_ams@yahoo.com>2012-03-24 15:49:34 -0700
committerRonald S. Bultje <rsbultje@gmail.com>2012-03-26 17:48:13 -0700
commit95b192de5d05f3e1542e7b2378cdefbc195f5185 (patch)
tree92c0653d19740b9374783bc757834d912bc916dc /libavcodec/vc1.c
parent2ad405548b754751a33f7d8532604eae7fe4ce54 (diff)
downloadffmpeg-95b192de5d05f3e1542e7b2378cdefbc195f5185.tar.gz
vc1: Do not read from array if index is invalid.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index 433baa9862..0e218af759 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -492,7 +492,7 @@ static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
int nr, dr;
nr = get_bits(gb, 8);
dr = get_bits(gb, 4);
- if (nr && nr < 8 && dr && dr < 3) {
+ if (nr > 0 && nr < 8 && dr > 0 && dr < 3) {
v->s.avctx->time_base.num = ff_vc1_fps_dr[dr - 1];
v->s.avctx->time_base.den = ff_vc1_fps_nr[nr - 1] * 1000;
}