X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmjpegdec.c;h=e005dd0cd3bf28a7d431de872b79ff12440d9e90;hb=64f9188aae2d5b9f94550285385c0110ea784226;hp=d980ac99a13b15a4bdcb6e8c840b2714ccda0baa;hpb=2eb20caccf0f030ddf8766850a177adf4c1d67fd;p=ffmpeg diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index d980ac99a13..e005dd0cd3b 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2428,7 +2428,10 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (p = 0; pnb_components; p++) { uint8_t *line = s->picture_ptr->data[p]; @@ -2487,7 +2490,10 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (p = 0; p < s->nb_components; p++) { uint8_t *dst; @@ -2515,7 +2521,10 @@ the_end: } if (s->flipped && !s->rgb) { int j; - avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + if (ret) + return ret; + av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format)); for (index=0; indexnb_components; index++) { uint8_t *dst = s->picture_ptr->data[index];