diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-24 12:22:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-24 12:22:51 +0100 |
commit | 4ba35194a9d79b80a606aafe8744d82de5b4bcf4 (patch) | |
tree | de96700a80c207195a640fd4f7a60e4aafcdc60e /libavutil/mem.c | |
parent | ccc7bcc4fcaab51abfc618a8d74fb1e7f07005f1 (diff) | |
parent | f935aca44c674d30e3ed940ef73bbad1228a5855 (diff) | |
download | ffmpeg-4ba35194a9d79b80a606aafe8744d82de5b4bcf4.tar.gz |
Merge commit 'f935aca44c674d30e3ed940ef73bbad1228a5855'
* commit 'f935aca44c674d30e3ed940ef73bbad1228a5855':
av_memcpy_backptr: avoid an infinite loop for back = 0
4xm: check the return value of read_huffman_tables().
Conflicts:
libavcodec/4xm.c
libavutil/mem.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mem.c')
-rw-r--r-- | libavutil/mem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c index 6d3efaabfa..a7fe60837b 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -323,7 +323,10 @@ 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 <= 1) { + if (!back) + return; + + if (back == 1) { memset(dst, *src, cnt); } else if (back == 2) { fill16(dst, cnt); |