[FFmpeg-cvslog] avcodec/qdrw: cleanup skip code

Michael Niedermayer git at videolan.org
Wed May 13 21:59:30 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed May 13 21:12:28 2015 +0200| [4b28907e4a947b7697fa44d5a80b6675ab152cc0] | committer: Michael Niedermayer

avcodec/qdrw: cleanup skip code

Skip 512 byte sectors until a non zero resolution is found

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b28907e4a947b7697fa44d5a80b6675ab152cc0
---

 libavcodec/qdrw.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c
index 8260395..1c3244b 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 */



More information about the ffmpeg-cvslog mailing list