changeset 6377:7eafa931f4e4 libavformat

Prevent overflow on random input.
author rbultje
date Fri, 13 Aug 2010 20:06:18 +0000
parents 91076395b8d3
children a5b3f5d68db6
files rtpdec_asf.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rtpdec_asf.c	Fri Aug 13 17:30:01 2010 +0000
+++ b/rtpdec_asf.c	Fri Aug 13 20:06:18 2010 +0000
@@ -230,7 +230,8 @@
                 int prev_len = out_len;
                 out_len += cur_len;
                 asf->buf = av_realloc(asf->buf, out_len);
-                memcpy(asf->buf + prev_len, buf + off, cur_len);
+                memcpy(asf->buf + prev_len, buf + off,
+                       FFMIN(cur_len, len - off));
                 url_fskip(pb, cur_len);
             }
         }