Commit b648b246 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

diracdec: add missing check for pixel_range_index

This fixes an out-of-bounds read introduced in commit 03796036.
Reviewed-by: 's avatarKieran Kunhya <kierank@obe.tv>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 7172175d
......@@ -262,6 +262,9 @@ static int parse_source_parameters(AVDiracSeqHeader *dsh, GetBitContext *gb,
dsh->bit_depth = luma_depth;
if (dsh->pixel_range_index < 2U)
return AVERROR_INVALIDDATA;
dsh->pix_fmt = dirac_pix_fmt[dsh->chroma_format][dsh->pixel_range_index-2];
avcodec_get_chroma_sub_sample(dsh->pix_fmt, &chroma_x_shift, &chroma_y_shift);
if ((dsh->width % (1<<chroma_x_shift)) || (dsh->height % (1<<chroma_y_shift))) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment