X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Flibopenjpegdec.c;h=401ea9b801ed51668bdff51477af7860d1ce2526;hb=2268db2cd052674fde55c7d48b7a5098ce89b4ba;hp=3da6eeceb250e7882e7c16778b9e617f1710ccba;hpb=6b3ef7f080293956b2e5212b83135c6b051212e9;p=ffmpeg diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 3da6eeceb25..401ea9b801e 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -94,22 +94,22 @@ static int libopenjpeg_matches_pix_fmt(const opj_image_t *img, switch (desc->nb_components) { case 4: match = match && - desc->comp[3].depth_minus1 + 1 >= img->comps[3].prec && + desc->comp[3].depth >= img->comps[3].prec && 1 == img->comps[3].dx && 1 == img->comps[3].dy; case 3: match = match && - desc->comp[2].depth_minus1 + 1 >= img->comps[2].prec && + desc->comp[2].depth >= img->comps[2].prec && 1 << desc->log2_chroma_w == img->comps[2].dx && 1 << desc->log2_chroma_h == img->comps[2].dy; case 2: match = match && - desc->comp[1].depth_minus1 + 1 >= img->comps[1].prec && + desc->comp[1].depth >= img->comps[1].prec && 1 << desc->log2_chroma_w == img->comps[1].dx && 1 << desc->log2_chroma_h == img->comps[1].dy; case 1: match = match && - desc->comp[0].depth_minus1 + 1 >= img->comps[0].prec && + desc->comp[0].depth >= img->comps[0].prec && 1 == img->comps[0].dx && 1 == img->comps[0].dy; default: @@ -365,7 +365,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, } desc = av_pix_fmt_desc_get(avctx->pix_fmt); - pixel_size = desc->comp[0].step_minus1 + 1; + pixel_size = desc->comp[0].step; ispacked = libopenjpeg_ispacked(avctx->pix_fmt); switch (pixel_size) {