From: Andre Noll Date: Sat, 24 Nov 2007 13:19:21 +0000 (+0100) Subject: Fix rename detection. X-Git-Tag: v0.3.0~101 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c195a65dc54ef2ad7f0e96fa63d45a580a3dac37;p=paraslash.git 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. --- 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;