[FFmpeg-cvslog] av_memcpy_backptr: avoid an infinite loop for back = 0
Anton Khirnov
git at videolan.org
Tue Feb 26 03:39:02 CET 2013
ffmpeg | branch: release/1.1 | Anton Khirnov <anton at khirnov.net> | Wed Feb 13 21:36:25 2013 +0100| [48fd461977f77f02668111769865e3740908e82a] | committer: Reinhard Tartler
av_memcpy_backptr: avoid an infinite loop for back = 0
CC:libav-stable at libav.org
(cherry picked from commit f935aca44c674d30e3ed940ef73bbad1228a5855)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=48fd461977f77f02668111769865e3740908e82a
---
libavutil/mem.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 3a4433d..391eb7d 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) {
More information about the ffmpeg-cvslog
mailing list