[FFmpeg-cvslog] asfdec_o: prevent overflow causing seekback

Andreas Cadhalpun git at videolan.org
Thu Jan 28 00:44:37 CET 2016


ffmpeg | branch: release/2.8 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Jan  6 14:09:22 2016 +0100| [782257ba66e0b0f4b6fa006a5ca059773478ccf5] | committer: Andreas Cadhalpun

asfdec_o: prevent overflow causing seekback

This fixes infinite loops.

Reviewed-by: Alexandra Hájková <alexandra.khirnova at gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit 74474750f1ac522730dae271a5ea5003caa8b73c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

 libavformat/asfdec_o.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 9ff0c4e..798f159 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -167,7 +167,7 @@ static void swap_guid(ff_asf_guid guid)
 
 static void align_position(AVIOContext *pb,  int64_t offset, uint64_t size)
 {
-    if (avio_tell(pb) != offset + size)
+    if (size < INT64_MAX - offset && avio_tell(pb) != offset + size)
         avio_seek(pb, offset + size, SEEK_SET);
 }
 



More information about the ffmpeg-cvslog mailing list