[FFmpeg-cvslog] avfilter/ass: make sure the log level are in available range
Clément Bœsch
git at videolan.org
Tue Sep 16 21:24:11 CEST 2014
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Thu Sep 11 21:09:39 2014 +0200| [a87527ad67377d502fc0731021239797cb8e9481] | committer: Clément Bœsch
avfilter/ass: make sure the log level are in available range
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a87527ad67377d502fc0731021239797cb8e9481
---
libavfilter/vf_subtitles.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 4fa1174..44273cb 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -80,7 +80,9 @@ static const int ass_libavfilter_log_level_map[] = {
static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx)
{
- int level = ass_libavfilter_log_level_map[ass_level];
+ const int ass_level_clip = av_clip(ass_level, 0,
+ FF_ARRAY_ELEMS(ass_libavfilter_log_level_map) - 1);
+ const int level = ass_libavfilter_log_level_map[ass_level_clip];
av_vlog(ctx, level, fmt, args);
av_log(ctx, level, "\n");
More information about the ffmpeg-cvslog
mailing list