mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'd57c737ac30cf079a342fa649fd4888c2d059dd9'
* commit 'd57c737ac30cf079a342fa649fd4888c2d059dd9': jpeg2000: Simplify jpeg2000_decode_packets() jpeg2000: Do not crash on NULL node in tag_tree_decode jpeg2000: Refactor SOT marker parsing Conflicts: libavcodec/jpeg2000dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
19ff6f55e8
|
@ -123,7 +123,7 @@ static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
|
||||||
int sp = -1, curval = 0;
|
int sp = -1, curval = 0;
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
while (node && !node->vis) {
|
while (node && !node->vis) {
|
||||||
stack[++sp] = node;
|
stack[++sp] = node;
|
||||||
|
@ -508,8 +508,8 @@ static int get_sot(Jpeg2000DecoderContext *s, int n)
|
||||||
return AVERROR_PATCHWELCOME;
|
return AVERROR_PATCHWELCOME;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->tile[s->curtileno].tp_idx = TPsot;
|
s->tile[Isot].tp_idx = TPsot;
|
||||||
tp = s->tile[s->curtileno].tile_part + TPsot;
|
tp = s->tile[Isot].tile_part + TPsot;
|
||||||
tp->tile_index = Isot;
|
tp->tile_index = Isot;
|
||||||
tp->tp_end = s->g.buffer + Psot - n - 2;
|
tp->tp_end = s->g.buffer + Psot - n - 2;
|
||||||
|
|
||||||
|
@ -720,13 +720,16 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
|
||||||
|
|
||||||
static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
|
static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
|
||||||
{
|
{
|
||||||
int layno, reslevelno, compno, precno, ok_reslevel, ret;
|
int ret = 0;
|
||||||
|
int layno, reslevelno, compno, precno, ok_reslevel;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
s->bit_index = 8;
|
s->bit_index = 8;
|
||||||
switch (tile->codsty[0].prog_order) {
|
switch (tile->codsty[0].prog_order) {
|
||||||
case JPEG2000_PGOD_LRCP:
|
|
||||||
case JPEG2000_PGOD_RLCP:
|
case JPEG2000_PGOD_RLCP:
|
||||||
|
avpriv_request_sample(s->avctx, "Progression order RLCP");
|
||||||
|
|
||||||
|
case JPEG2000_PGOD_LRCP:
|
||||||
for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
|
for (layno = 0; layno < tile->codsty[0].nlayers; layno++) {
|
||||||
ok_reslevel = 1;
|
ok_reslevel = 1;
|
||||||
for (reslevelno = 0; ok_reslevel; reslevelno++) {
|
for (reslevelno = 0; ok_reslevel; reslevelno++) {
|
||||||
|
@ -799,6 +802,16 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case JPEG2000_PGOD_RPCL:
|
||||||
|
avpriv_request_sample(s->avctx, "Progression order RPCL");
|
||||||
|
ret = AVERROR_PATCHWELCOME;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JPEG2000_PGOD_PCRL:
|
||||||
|
avpriv_request_sample(s->avctx, "Progression order PCRL");
|
||||||
|
ret = AVERROR_PATCHWELCOME;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -806,7 +819,7 @@ static int jpeg2000_decode_packets(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile
|
||||||
/* EOC marker reached */
|
/* EOC marker reached */
|
||||||
bytestream2_skip(&s->g, 2);
|
bytestream2_skip(&s->g, 2);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TIER-1 routines */
|
/* TIER-1 routines */
|
||||||
|
|
Loading…
Reference in New Issue