Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-05 00:58:49 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-18 01:13:19 +0300
commitc72ac9ffd017ce04238f380260d8fc9e22266d7b (patch)
tree614a72413feecb68f499150e303a729877c9d3b1 /libavcodec/lzf.c
parent31cebfe789ff07248726043daaa6b5375ce57389 (diff)
lzf: update pointer p after realloc
This fixes heap-use-after-free detected by AddressSanitizer. Reviewed-by: Luca Barbato <lu_zero@gentoo.org> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit bb6a7b6f75ac544c956e3eefee297700ef4d3468) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/lzf.c')
-rw-r--r--libavcodec/lzf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/lzf.c b/libavcodec/lzf.c
index 409a7ffdd3..5b7526ef18 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);