You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/mjpegdec: fix regression with baseline RGB JPEGs
Commit b18a9c2971
introduced a regression
that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes
that.
Signed-off-by: Leo Izen <leo.izen@gmail.com>
This commit is contained in:
@@ -1698,6 +1698,9 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
|
|||||||
s->h_scount[i] = s->h_count[index];
|
s->h_scount[i] = s->h_count[index];
|
||||||
s->v_scount[i] = s->v_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)
|
||||||
|
index = (index+2)%3;
|
||||||
|
|
||||||
s->comp_index[i] = index;
|
s->comp_index[i] = index;
|
||||||
|
|
||||||
s->dc_index[i] = get_bits(&s->gb, 4);
|
s->dc_index[i] = get_bits(&s->gb, 4);
|
||||||
@@ -2721,7 +2724,7 @@ the_end:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
|
if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP && s->progressive) {
|
||||||
av_assert0(s->nb_components == 3);
|
av_assert0(s->nb_components == 3);
|
||||||
FFSWAP(uint8_t *, frame->data[0], frame->data[2]);
|
FFSWAP(uint8_t *, frame->data[0], frame->data[2]);
|
||||||
FFSWAP(uint8_t *, frame->data[0], frame->data[1]);
|
FFSWAP(uint8_t *, frame->data[0], frame->data[1]);
|
||||||
|
Reference in New Issue
Block a user