asfdec: prevent the infinite loop in detect unknown_subobject
authorAlexandra Hájková <alexandra.khirnova@gmail.com>
Thu, 2 Jul 2015 12:17:20 +0000 (14:17 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 2 Jul 2015 23:50:09 +0000 (01:50 +0200)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/asfdec.c

index f2dd489..9989b80 100644 (file)
@@ -1591,6 +1591,8 @@ static int detect_unknown_subobject(AVFormatContext *s, int64_t offset, int64_t
     int ret;
 
     while (avio_tell(pb) <= offset + size) {
+        if (avio_tell(pb) == asf->offset)
+            break;
         asf->offset = avio_tell(pb);
         if ((ret = ff_get_guid(pb, &guid)) < 0)
             return ret;