Commit 74474750 authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

asfdec_o: prevent overflow causing seekback

This fixes infinite loops.
Reviewed-by: 's avatarAlexandra Hájková <alexandra.khirnova@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 0002d845
...@@ -167,7 +167,7 @@ static void swap_guid(ff_asf_guid guid) ...@@ -167,7 +167,7 @@ static void swap_guid(ff_asf_guid guid)
static void align_position(AVIOContext *pb, int64_t offset, uint64_t size) 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); avio_seek(pb, offset + size, SEEK_SET);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment