Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-13 22:12:28 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-05-13 22:49:21 +0300
commit4b28907e4a947b7697fa44d5a80b6675ab152cc0 (patch)
treeb41c5afdf7f716757d42b79f5622ee67b83ad2c7 /libavcodec/qdrw.c
parentb6e8166a489d4c681e8a56483b9506d4f27e9ad0 (diff)
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.c10
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 */