On Sat, 16 Feb 2013, Anton Khirnov wrote:
CC:[email protected] --- libavutil/mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)diff --git a/libavutil/mem.c b/libavutil/mem.c index 3a4433d..bb398fd 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -252,7 +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 == 1) { + if (!back) + return; + else if (back == 1) { memset(dst, *src, cnt); } else if (back == 2) { fill16(dst, cnt); -- 1.7.10.4
Probably ok - does this happening indicate bugs elsewhere that also should have caught the issue earlier?
Also stylistic nitpick - you could keep the if (back == 1) unchanged since you return. Or add braces around that clause since that's what's used in the later one (I find it odd to omit braces for some parts of a long if/else if).
// Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
