From c195a65dc54ef2ad7f0e96fa63d45a580a3dac37 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 24 Nov 2007 14:19:21 +0100 Subject: [PATCH] Fix rename detection. If a file is renamed and re-added the old code would segfault because of a NULL pointer dereference in save_chunk_table(). Fix is trivial. --- aft.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aft.c b/aft.c index 7af50f9d..40c7e106 100644 --- a/aft.c +++ b/aft.c @@ -1429,7 +1429,8 @@ static void save_audio_file_info(HASH_TYPE *hash, const char *path, pos += afhi_size; PARA_DEBUG_LOG("size: %zu, chunks start at %d\n", size, pos); write_u16(buf + AFTROW_CHUNKS_OFFSET_POS, pos); - save_chunk_table(afhi, buf + pos); + if (afhi) + save_chunk_table(afhi, buf + pos); PARA_DEBUG_LOG("last byte in buf: %p\n", buf + size - 1); obj->data = buf; obj->size = size; -- 2.39.5