Commit 4ec14ce1 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dec: Improve readability of SOP check

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9ba5fe7f
......@@ -58,6 +58,9 @@ enum Jpeg2000Markers {
JPEG2000_EOC = 0xffd9, // end of codestream
};
#define JPEG2000_SOP_FIXED_BYTES 0xFF910004
#define JPEG2000_SOP_BYTE_LENGTH 6
enum Jpeg2000Quantsty { // quantization style
JPEG2000_QSTY_NONE, // no quantization
JPEG2000_QSTY_SI, // scalar derived
......
......@@ -812,8 +812,8 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile,
}
}
if (bytestream2_peek_be32(&s->g) == 0xFF910004)
bytestream2_skip(&s->g, 6);
if (bytestream2_peek_be32(&s->g) == JPEG2000_SOP_FIXED_BYTES)
bytestream2_skip(&s->g, JPEG2000_SOP_BYTE_LENGTH);
if (!(ret = get_bits(s, 1))) {
jpeg2000_flush(s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment