Message ID | 20230417192955.25912-2-leo.izen@gmail.com |
---|---|
State | New |
Headers | show |
Series | RGB mjpeg fixes | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 01537d4774..1e3ddb72fb 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1698,7 +1698,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, s->h_scount[i] = s->h_count[index]; s->v_scount[i] = s->v_count[index]; - if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBRP) + if((nb_components == 3 || nb_components == 1) && s->nb_components == 3 + && s->avctx->pix_fmt == AV_PIX_FMT_GBRP && !s->progressive) index = (index+2)%3; s->comp_index[i] = index;