[SCM] libav/experimental: log: Remove undefined behaviour
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Aug 10 16:02:35 UTC 2014
The following commit has been merged in the experimental branch:
commit 28b9ac4e48f3405a82e8e87ead336188215cf1e6
Author: Luca Barbato <lu_zero at gentoo.org>
Date: Thu Apr 3 13:51:47 2014 +0000
log: Remove undefined behaviour
diff --git a/libavutil/log.c b/libavutil/log.c
index c447b5a..6522ef3 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -117,7 +117,7 @@ void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl)
char line[1024];
static int is_atty;
AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
- int tint = av_clip(level >> 8, 0, 256);
+ unsigned tint = level & 0xff00;
level &= 0xff;
@@ -157,7 +157,7 @@ void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl)
fprintf(stderr, " Last message repeated %d times\n", count);
count = 0;
}
- colored_fputs(av_clip(level >> 3, 0, 6), tint, line);
+ colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, line);
av_strlcpy(prev, line, sizeof line);
}
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list