diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-02-13 21:36:25 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-02-23 09:16:15 +0100 |
commit | f935aca44c674d30e3ed940ef73bbad1228a5855 (patch) | |
tree | 4b8271dfb6a80f3b62fd9e4025a4baad435cd3d6 /libavutil | |
parent | 8097fc9a2dd49d8e467b16c8bafaa96242b7fe46 (diff) | |
download | ffmpeg-f935aca44c674d30e3ed940ef73bbad1228a5855.tar.gz |
av_memcpy_backptr: avoid an infinite loop for back = 0
CC:libav-stable@libav.org
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/mem.c | 3 |
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) { |