Browse Source

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 7f7af9e294)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.1.5
Michael Niedermayer 6 years ago
parent
commit
79dffb7f2c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/vc1.c

+ 3
- 1
libavcodec/vc1.c View File

@@ -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)


Loading…
Cancel
Save