avformat/sdp: Fix potential write beyond end of buffer