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>
This commit is contained in:
Andreas Cadhalpun 2016-11-04 23:33:02 +01:00 committed by Luca Barbato
parent ab839054e6
commit 43de8b328b
1 changed files with 2 additions and 0 deletions

View File

@ -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);