diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-13 21:12:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-13 21:49:21 +0200 |
commit | 4b28907e4a947b7697fa44d5a80b6675ab152cc0 (patch) | |
tree | b41c5afdf7f716757d42b79f5622ee67b83ad2c7 /libavcodec/qdrw.c | |
parent | b6e8166a489d4c681e8a56483b9506d4f27e9ad0 (diff) | |
download | ffmpeg-4b28907e4a947b7697fa44d5a80b6675ab152cc0.tar.gz |
avcodec/qdrw: cleanup skip code
Skip 512 byte sectors until a non zero resolution is found
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qdrw.c')
-rw-r--r-- | libavcodec/qdrw.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 8260395c88..1c3244b036 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -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 */ |