You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
libavcodec/jpeg2000dec : Prevent overriding SOP marker bit
Currently, the COC marker overrides the SOP marker bit. However, only the COD marker may set this value. This patch fixes this bug. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
24c575e0aa
commit
05f3d37dd5
@@ -588,7 +588,7 @@ static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
|
|||||||
uint8_t *properties)
|
uint8_t *properties)
|
||||||
{
|
{
|
||||||
int compno, ret;
|
int compno, ret;
|
||||||
uint8_t has_eph;
|
uint8_t has_eph, has_sop;
|
||||||
|
|
||||||
if (bytestream2_get_bytes_left(&s->g) < 2) {
|
if (bytestream2_get_bytes_left(&s->g) < 2) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for COC\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Insufficient space for COC\n");
|
||||||
@@ -606,8 +606,10 @@ static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
|
|||||||
|
|
||||||
c += compno;
|
c += compno;
|
||||||
has_eph = c->csty & JPEG2000_CSTY_EPH;
|
has_eph = c->csty & JPEG2000_CSTY_EPH;
|
||||||
|
has_sop = c->csty & JPEG2000_CSTY_SOP;
|
||||||
c->csty = bytestream2_get_byteu(&s->g);
|
c->csty = bytestream2_get_byteu(&s->g);
|
||||||
c->csty |= has_eph; //do not override eph present bits from COD
|
c->csty |= has_eph; //do not override eph present bits from COD
|
||||||
|
c->csty |= has_sop; //do not override sop present bits from COD
|
||||||
|
|
||||||
if ((ret = get_cox(s, c)) < 0)
|
if ((ret = get_cox(s, c)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user