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

avcodec/qdrw: cleanup skip code

Skip 512 byte sectors until a non zero resolution is found
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b6e8166a
......@@ -124,13 +124,9 @@ static int decode_frame(AVCodecContext *avctx,
int w, h, ret;
bytestream2_init(&gbc, avpkt->data, avpkt->size);
if ( avpkt->size >= 552
&& AV_RB32(&avpkt->data[ 10]) != 0x001102FF
&& AV_RB32(&avpkt->data[522]) == 0x001102FF)
bytestream2_skip(&gbc, 512);
/* PICT images start with a 512 bytes empty header */
if (bytestream2_peek_be32(&gbc) == 0)
while ( bytestream2_get_bytes_left(&gbc) >= 552
&& ( !AV_RB16(&avpkt->data[bytestream2_tell(&gbc)+6])
|| !AV_RB16(&avpkt->data[bytestream2_tell(&gbc)+8])))
bytestream2_skip(&gbc, 512);
/* smallest PICT header */
......
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