diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2016-11-04 23:33:02 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-11-07 22:42:00 +0100 |
commit | 43de8b328b62cf21ec176c3989065168da471a5f (patch) | |
tree | c3ca857e32686031d593761438875fd8f53d1b91 /libavcodec | |
parent | ab839054e662d3227e1f795ba1dfd01fe1cf305c (diff) | |
download | ffmpeg-43de8b328b62cf21ec176c3989065168da471a5f.tar.gz |
lzf: update pointer p after realloc
This fixes heap-use-after-free detected by AddressSanitizer.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/lzf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/lzf.c b/libavcodec/lzf.c index 35b932bd08..0329fe0eec 100644 --- a/libavcodec/lzf.c +++ b/libavcodec/lzf.c @@ -53,6 +53,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size) ret = av_reallocp(buf, *size); if (ret < 0) return ret; + p = *buf + len; } bytestream2_get_buffer(gb, p, s); @@ -75,6 +76,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size) ret = av_reallocp(buf, *size); if (ret < 0) return ret; + p = *buf + len; } av_memcpy_backptr(p, off, l); |