aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vc1.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-31 22:00:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:47 +0100
commitfca0a31b482fd5f1786f24420fe4878ade6a4b0e (patch)
treef5ca82d98cb8bb6b0ee7f3af911f1771a32d6940 /libavcodec/vc1.c
parent98c4cec8ba7580b8a0161c40161bfdc55890bff8 (diff)
downloadffmpeg-fca0a31b482fd5f1786f24420fe4878ade6a4b0e.tar.gz
avcodec/vc1: check REFDIST
"9.1.1.43 P Reference Distance (REFDIST)" "The value of REFDIST shall be less than, or equal to, 16." Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7f7af9e294f8bc00756922ab088430ea5b9d7498) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/vc1.c')
-rw-r--r--libavcodec/vc1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index e7625070f7..aa4213574f 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -938,7 +938,9 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
else if ((v->s.pict_type != AV_PICTURE_TYPE_B) && (v->s.pict_type != AV_PICTURE_TYPE_BI)) {
v->refdist = get_bits(gb, 2);
if (v->refdist == 3)
- v->refdist += get_unary(gb, 0, 16);
+ v->refdist += get_unary(gb, 0, 14);
+ if (v->refdist > 16)
+ return AVERROR_INVALIDDATA;
}
if ((v->s.pict_type == AV_PICTURE_TYPE_B) || (v->s.pict_type == AV_PICTURE_TYPE_BI)) {
if (read_bfraction(v, gb) < 0)