X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdirac.c;h=faf5534e88fe19bc3975f741709b05bf5e049a82;hb=774c5357dbe62ba6017ecbe6738a73644cd5bb5d;hp=33cc96098c96cdcf62f6440641b8387aac1cf608;hpb=06d69a2d225ae0db433b62f0fa537b06e29b0db5;p=ffmpeg diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 33cc96098c9..faf5534e88f 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -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<height % (1<