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.
This commit is contained in:
Alex Converse
2012-06-04 18:27:03 -07:00
parent 503f2feb14
commit ecf79c4d3e
4 changed files with 17 additions and 4 deletions

View File

@@ -340,7 +340,8 @@ static int create_vorbis_context(vorbis_enc_context *venc,
};
fc->list[i].x = a[i - 2];
}
ff_vorbis_ready_floor1_list(fc->list, fc->values);
if (ff_vorbis_ready_floor1_list(avccontext, fc->list, fc->values))
return AVERROR_BUG;
venc->nresidues = 1;
venc->residues = av_malloc(sizeof(vorbis_enc_residue) * venc->nresidues);