log: Remove undefined behaviour

This commit is contained in:
Luca Barbato 2014-04-03 13:51:47 +00:00 committed by Vittorio Giovara
parent 7763118cae
commit 28b9ac4e48
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}