diff options
author | Alex Converse <alex.converse@gmail.com> | 2012-06-04 18:27:03 -0700 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2012-06-05 09:51:51 -0700 |
commit | ecf79c4d3e8baaf2f303278ef81db6f8407656bc (patch) | |
tree | 5a0f45fbc87f874fc2194128f37361fc23074657 /libavcodec/vorbisdec.c | |
parent | 503f2feb143b58bf9b7850ef00ec0bb02d509f78 (diff) | |
download | ffmpeg-ecf79c4d3e8baaf2f303278ef81db6f8407656bc.tar.gz |
vorbis: Validate that the floor 1 X values contain no duplicates.
Duplicate values in this vector are explicitly banned by the Vorbis I spec
and cause divide-by-zero crashes later on.
Diffstat (limited to 'libavcodec/vorbisdec.c')
-rw-r--r-- | libavcodec/vorbisdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 36db356f27..3489b8f029 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -574,7 +574,11 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) } // Precalculate order of x coordinates - needed for decode - ff_vorbis_ready_floor1_list(floor_setup->data.t1.list, floor_setup->data.t1.x_list_dim); + if (ff_vorbis_ready_floor1_list(vc->avccontext, + floor_setup->data.t1.list, + floor_setup->data.t1.x_list_dim)) { + return AVERROR_INVALIDDATA; + } } else if (floor_setup->floor_type == 0) { unsigned max_codebook_dim = 0; |