1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-14 20:33:00 +02:00

jpeg2000: Propagate error code from get_cox()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Michael Niedermayer 2013-07-01 10:01:12 +02:00 committed by Luca Barbato
parent 78962d3df4
commit ef35d6dbc6

View File

@ -330,7 +330,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
uint8_t *properties)
{
Jpeg2000CodingStyle tmp;
int compno;
int compno, ret;
if (bytestream2_get_bytes_left(&s->g) < 5)
return AVERROR_INVALIDDATA;
@ -343,7 +343,9 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
tmp.nlayers = bytestream2_get_be16u(&s->g);
tmp.mct = bytestream2_get_byteu(&s->g); // multiple component transformation
get_cox(s, &tmp);
if ((ret = get_cox(s, &tmp)) < 0)
return ret;
for (compno = 0; compno < s->ncomponents; compno++)
if (!(properties[compno] & HAD_COC))
memcpy(c + compno, &tmp, sizeof(tmp));
@ -355,7 +357,7 @@ static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
uint8_t *properties)
{
int compno;
int compno, ret;
if (bytestream2_get_bytes_left(&s->g) < 2)
return AVERROR_INVALIDDATA;
@ -371,7 +373,9 @@ static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
c += compno;
c->csty = bytestream2_get_byteu(&s->g);
get_cox(s, c);
if ((ret = get_cox(s, c)) < 0)
return ret;
properties[compno] |= HAD_COC;
return 0;