From 7edb984dd051b6919d7d8471c70499273f31b0fa Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 30 Apr 2013 20:05:31 +0200 Subject: [PATCH] avutil/log: Fix context pointer used for get_category() Fixes calling a random pointer Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavutil/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/log.c b/libavutil/log.c index f29345b97a..15ff5f86bc 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -180,7 +180,7 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl, if (parent && *parent) { snprintf(part[0], part_size, "[%s @ %p] ", (*parent)->item_name(parent), parent); - if(type) type[0] = get_category(((uint8_t *) ptr) + avc->parent_log_context_offset); + if(type) type[0] = get_category(parent); } } snprintf(part[1], part_size, "[%s @ %p] ",