[FFmpeg-devel] [PATCH 2/5] asfdec_o: prevent overflow causing seekback

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Jan 15 01:02:37 CET 2016


On 06.01.2016 19:55, Andreas Cadhalpun wrote:
> This fixes infinite loops.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  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 bc168d3..b81519f 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);
>  }
>  
> 

Pushed now, as Alexandra (the author over at Libav) seems fine with it.

Best regards,
Andreas


More information about the ffmpeg-devel mailing list