aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-13 21:36:25 +0100
committerReinhard Tartler <siretart@tauware.de>2013-02-23 14:40:30 +0100
commit48fd461977f77f02668111769865e3740908e82a (patch)
tree0de5e7da9bd6250076320f5376d8a85784876bfc /libavutil
parent612b28194b4c1fb55c8620a8cddf77ea6e81b9bf (diff)
downloadffmpeg-48fd461977f77f02668111769865e3740908e82a.tar.gz
av_memcpy_backptr: avoid an infinite loop for back = 0
CC:libav-stable@libav.org (cherry picked from commit f935aca44c674d30e3ed940ef73bbad1228a5855) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/mem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 3a4433d154..391eb7db38 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -252,6 +252,9 @@ static void fill32(uint8_t *dst, int len)
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
{
const uint8_t *src = &dst[-back];
+ if (!back)
+ return;
+
if (back == 1) {
memset(dst, *src, cnt);
} else if (back == 2) {