X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdirac.c;h=527f015e11ac39070203ea4929012755c8149659;hb=43a69655699bb115df6c760e14dbe319ac38e0cd;hp=faf5534e88fe19bc3975f741709b05bf5e049a82;hpb=40231a58a0d8bffbe2264fe980483edaa6fc422e;p=ffmpeg diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index faf5534e88f..527f015e11a 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; + /* Full range 8 bts uses the same pix_fmts as limited range 8 bits */ + dsh->pixel_range_index += dsh->pixel_range_index == 1; + if (dsh->pixel_range_index < 2U) return AVERROR_INVALIDDATA; @@ -346,8 +349,10 @@ int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, else if (dsh->version.major > 2 && log_ctx) av_log(log_ctx, AV_LOG_WARNING, "Stream may have unhandled features\n"); - if (video_format > 20U) - return AVERROR_INVALIDDATA; + if (video_format > 20U) { + ret = AVERROR_INVALIDDATA; + goto fail; + } /* Fill in defaults for the source parameters. */ dsh->width = dirac_source_parameters_defaults[video_format].width;