History

avcodec/mjpegdec: fix regression with baseline RGB JPEGs

Commit b18a9c29713abc3a1b081de3f320ab53a47120c6 introduced a regression that broke some baseline RGB jpegs. (See Trac issue #4045). This fixes that.

Leo Izen committed 3 years ago

Commit c3625cc1 parent 0b0fa5c1 file · +4 −1Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mjpegdec.c+4−1
@@ -1698,6 +1698,9 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, · 1697 unmodified lines
16981698 s->h_scount[i] = s->h_count[index];
16991699 s->v_scount[i] = s->v_count[index];
17001700
1701+ if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBRP)
1702+ index = (index+2)%3;
1703+
17011704 s->comp_index[i] = index;
17021705
17031706 s->dc_index[i] = get_bits(&s->gb, 4);
@@ -2721,7 +2724,7 @@ the_end: · 1017 unmodified lines
27212724 }
27222725 }
27232726
2724− if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
2727+ if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP && s->progressive) {
27252728 av_assert0(s->nb_components == 3);
27262729 FFSWAP(uint8_t *, frame->data[0], frame->data[2]);
27272730 FFSWAP(uint8_t *, frame->data[0], frame->data[1]);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t